Expand my Community achievements bar.

SOLVED

form printing,

Avatar

Level 2

so I have a weird question.... I have been working on developing a form in LiveCycle Designer. The problem is, that when it is printed, it has to be on a double-sided, 4 x 6, green index card. I have played around with trying to force print sizes, but it always seems to revert back to 8 x 11.5 when printing.

I am now wondering about also using visible only on screen text fields, and trying to exactly duplicate the card so that when it is printed, the info would show up, but not the text feilds (which would already be on the form) and just letting people insert the actual card into the printer for printing of the data. Before I do too much, does anyone have any other suggestions which might work as well?

thank you very much.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

I have not been able to get the "getPrintParam" to work. I remember trying to get this working before and not being sucessful then either. It is documented in the Acrobat API guidance document (available from the Adobe web site), but it is written for the Acrobat Javascript.  For example,

this.getPrintParams();    becomes     event.target.getPrintParams();

While I can get this to work, pushing this to print with a flag "setPageSize" has not been sucessful.

I am uploading a form, which may be of some assistance. Basically the fake print button first calls the page setup menu command. This is a prompt to the user to change the page size from A4 to A6 (this is the closest I could find to 4x6; however you may have a better paper size in your locale).

I appreciate that this is not fully automatic, but along with some suitable text (or app.alert) you can tell the user what paper they need to specify before hitting the print dialogue.

25-08-2009 18-55-42.png

The template script in the XML Source is driven by the Form Properties dialogue, so you would be better to make the changes there rather than directly in the XML Source. There isn't anything there that will help you in your particular requirement.

25-08-2009 18-50-49.png

I hope that helps you,

Niall

View solution in original post

21 Replies

Avatar

Level 10

Hi,

Have you tried setting up the Master Page to a custom szie of 4x6?

If you go to the Master Page and set the page size to 4x6 and then set out your form as a 2-page document. Also drag in a print button. It will have built in script like this:

xfa.host.print(1, "0", "1", 0, 1, 0, 0, 0);

The fifth parameter is important; 1 sets the page to scale to fit the 4x6 paper in the print dialogue/printer.

This way WYSIWYG, the user will fill in a 2-page form and it should then also print on the card, without having to duplicate fields and have fields with different presences.

Good luck,

Niall

Avatar

Level 2

Thank you for your help. I've got the master page and the 2nd page set-up and I have set in the print button. My script looks like this:

xfa.host.print(1

, "0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0,

0);

(the other stuff was there and I just changed the fifth number to a 1)

It comes up looking like a 4 x 6 card, but when it prints, it still scales to an 8.5 x 11 (attached)

did I miss something?

Thanks again for your help!

Nancy.

Avatar

Level 10

Hi,

I am away from the computer at the moment, so I can't check at the moment.

Try setting the 5th param back to "0", no scalling.

Another option, if I presume that you are in a Windows environment I would recommend that when the print dialogue comes up that you go into the printer preferences/settings and change the paper size to 4x6. If that works OK, then I would install a copy of that printer and rename it "Green 4x6 card". Then set that version of the printer to paper size 4x6. When printing this form you would have to select this printer.

Adobe AcroForms have slightly more control over the printer, but I am fairly sure that these options are not available in LC Designer.

Hope you get it working,

N.

Avatar

Level 2

Thanks Niall-

I tried swqitching the parameter but still no luck. And so far as making a new printer- it's notjust for me. I have database of information ofdiffrent people, that when they log in, they might be printing from any number oflocations. So, what I need is to force a standard print size for everyone- not just fr me.

for instance- people will be receiving a green index card that they are supposed to hand fill in. I would like then to be able to set that green card into their printer and print from my system, using my stored data.

Would still love any more info on this!

Thanks much.

Avatar

Level 10

OK, there are a few things:

Can you check the printer preferences in the print dialogue. If the form is 4x6 and the scale is set to "no scalling" then the issue could be that the printer is set to letter/A4.

When Acrobat prints (via menu or button) it hands over the print job to Windows. The user will need to specify a paper tray and paper size for the 4x6 card.

When you get this working (fingers crossed) you could put in an app.alert reminding the users to put the green 4x6 card into the printer and set the printer preferences.

You are basically dealing with two systems

1) Abobe is telling Windows to print an 4x6 card full size; and

2) Windows taking the print job and giving it to the default printer with its default settings.

If the user wants to print on a paper size that is not default, they will need to specify that.

Hope that helps,

N.

Avatar

Level 2

so basically, it seems (logically so) that there is no real way to tell the printer how to print. I need to set up these instructions for the user BEFORE they print. If my form is created correctly, and if the user manipulates the settings on their end (through the print dialogue box) it will then correctly print the right size on the 4 x 6 card...

Avatar

Level 10

Hi Nancy,

That's it in a nutshell. I am sure AcroForms can control print settings more, something like getPrintParams, but that these are not available in LC Designer XFA forms. I stand to be corrected.

Did changing the printer preferences work? If it did, then yes you would need to tell the users to do this.

Good luck,

Niall

Please contact me if you have any queries in relation to the above.

Regards,

Niall O'Donovan

Assure Health & Safety Consultants

086 2671985

Avatar

Level 2

what is acroforms exactly?

does anyone knwo if there is such a feature in LiveCycle?

Avatar

Level 7

Acroforms refers to creating forms through Acrobat as opposed to using Designer.

Avatar

Level 2

I think I also just figured this out.  thanks very much. One question (forgive if this is basic). I get this from Acrobat help:

A PDF can contain a set of print presets, a group of document-specific values that is used to set basic print options. By creating a print preset for a document, you can avoid manually setting certain options in the Print dialog box each time you print the document. It’s best to define print settings for a PDF at the time that you create it, but print presets provide a means to add basic print settings to a PDF at any time.

  1. Choose File > Properties, and click the Advanced tab.
  2. In the Print Dialog Presets section, set options and click OK.

however, on my test form, these presets are greyed out and not available to me. Is there a setting that I should consider in LiveCycle before opening in Acrobat, to make the print presets available.

Avatar

Level 10

Hi,

AcroForms are forms that you create in Acrobat directly. You end up with a similar form, but use slightly different Javascript. It does not have the same level of dynamic functionality as LC Designer AND I am not sure if it can talk to databases.

Hope you get a solution,

Niall

Avatar

Level 10

Hi,

I am slow typing on the phone

XFA forms (LC Designer) and AcroForms (Acrobat) are two different things. LC puts the XFA form in a "wrapper", which Acrobat can open.

When an XFA form is opened in Acrobat there are several Acrobat features that are not available.

I may have a script back at base, that might help, but it won't fully automate it.

N.

Avatar

Level 2

no problem on the response time- thank you very much for what you are doing! I've also notioced from a few other posts that this has come up a few past times and you have been involved with those solutions as well.

I would love the script if you had it. I use acrobat anyway to enable rights useages, so I need to open the form up there as well.

I did notice in the source this code:

<?PDFPrintOptions embedViewerPrefs 1?>

<?PDFPrintOptions embedPrintOnFormOpen 0?>

<?PDFPrintOptions duplexMode 2?>

is there anything that can be adjusted there?

Avatar

Level 10

You have "Fit to Printable Area" turned on in your print dialog. Have you set your page size in the print driver?

Avatar

Correct answer by
Level 10

Hi,

I have not been able to get the "getPrintParam" to work. I remember trying to get this working before and not being sucessful then either. It is documented in the Acrobat API guidance document (available from the Adobe web site), but it is written for the Acrobat Javascript.  For example,

this.getPrintParams();    becomes     event.target.getPrintParams();

While I can get this to work, pushing this to print with a flag "setPageSize" has not been sucessful.

I am uploading a form, which may be of some assistance. Basically the fake print button first calls the page setup menu command. This is a prompt to the user to change the page size from A4 to A6 (this is the closest I could find to 4x6; however you may have a better paper size in your locale).

I appreciate that this is not fully automatic, but along with some suitable text (or app.alert) you can tell the user what paper they need to specify before hitting the print dialogue.

25-08-2009 18-55-42.png

The template script in the XML Source is driven by the Form Properties dialogue, so you would be better to make the changes there rather than directly in the XML Source. There isn't anything there that will help you in your particular requirement.

25-08-2009 18-50-49.png

I hope that helps you,

Niall

Avatar

Level 2

Actually, this is beautiful! This willl work perfectly with a bit of instructions for the user, and for them just to put the green card into the computer. Thank you very much for all of your help!

Just a quick, (possibly a different thread) question as well.. I can get blank green cards to most users to use for printing, but some people will have green cards which have been given to them. These cards will have printed feilds that will be asking users to fill them out by hand. *if* using these print functions, I was able, in livecycle to lay the card feilds out identically on the screen- and then the feilds were populated with my data, is there a way to make the entered data visible on print, but not the feild (by using the visible- screen only or other functions) ?

again... THANK YOU for your help!

Avatar

Level 10

Hi,

There are a couple of options, depending on the number of fields. You would need two fake print buttons: "Print using blank card" and "Print using pre-printed card".

One option would be to have the script (in the print button) run through all the fields and turn off the borders and captions.

prePrint:

objectName.caption.font.fill.color.value = "255,255,255"

for (var i=0; i<4; i++) {
  objectName.ui.oneOfChild.border.getElement("edge",i).color.value = "255,255,255";
}

postPrint:

objectName.caption.font.fill.color.value = "0,0,0"

for (var i=0; i<4; i++) {
   objectName.ui.oneOfChild.border.getElement("edge",i).color.value = "0,0,0";
}

This is a bit convoluted...

OR

Another option would be to finalise the form with the borders and captions, then

  1. name all of the objects uniquely;
  2. set their binding to global in the Object / Binding tab;
  3. duplicate the two pages and name each page uniquely;
  4. then in the pre-printed version of the form set the captions to null and no borders;
  5. set the presence of these pages to hidden;
  6. the main print button will work as before;
  7. but the "Print on pre-printed cards" would hide the original two pages and make visible the other 2 pages (with no captions / borders) on the prePrint;
  8. on postPrint you would need script to hide the 2 pages (with no captions / borders) and make visible again the main two pages;
  9. becuase the objects are set to global, the data that the user fills in will appear in both sets of printed options.

Someone else may have a prettier solution. Good luck,

N.

Avatar

Level 2

sorry.. completely lost on the second solution. Do I need more than one page, or are you saying that I should have duplicate forms and subforms on one page?

on the first.. would the  one pt hide all of the borders for the form, or would I need a script for each field?

Avatar

Level 10

Hi,

I am uploading a sample of the second solution.

Basically you will see one page (page1a) which is visible and all of the fields have captions and borders. Also there are title, supporting text and buttons. This is what the user will see.

There is also a hidden page (page1b), which the user does not see. It just contains the fields, without captions and with the borders set to solid and white. If the user has a pre-printed card they hit the bottom button, which will hide page1a and show page1b.

Hopefully you will be able to apply this to your form.

Good luck,

N.

Avatar

Level 2

Geez Naill-

you have been so very helpful. Thank you so much!

This solution would probably work beautifully. However- I cannot see how you CREATED (and how I would created/edit) the hidden form in livecycle. I'll keep working on it. Thanks again.

Nancy.