Skip navigation
Zayed_Stell
Currently Being Moderated

Printing button in PDF fillable form.

Jul 2, 2012 2:20 AM

Dear All,

 

I have created a PDF fillable form with a button which save & print the pdf.

The code for is as fallow:

 

Formular1.#pageSet[0].Seite1.Bildfeld1::click - (JavaScript, client)

var Mailto = "info@stell.de";

 

var Betreff = Textfeld1.rawValue;

 

var Nachricht = "Dies ist eine Telefonnotiz\r2.Zeile Hier";

 

var CC = "info@stell.de";

 

var BCC = "info@stell.de";

 

var Mail = "mailto:" + Mailto + "?Subject=" + Betreff + "&Body=" + Nachricht + "&cc=" + CC + "&bcc=" + BCC;

 

  1. event.target.submitForm({

 

cURL: Mail,

 

bEmpty: false,

 

cSubmitAs: "PDF"

 

 

});

  1. event.target.closeDoc(true); (FormClac)

Formular1.#pageSet[0].Seite1.DruckenSchaltfläche1::click - (JavaScript, client)

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

 

 

my problem now is that with this script I can print and save the file even though all required fields are not filled!! I donot anyone to have the possibility to print the file or save it unless he fill all required fileds.

 

  1. Any Idea, coz Iam new in the Adobe Livecycle world
 
Replies
  • Currently Being Moderated
    Jul 2, 2012 2:47 AM   in reply to Zayed_Stell

    HI,

     

    you can use the validate element to prevent users from printing a form.

    See: http://forms.stefcameron.com/2008/04/13/prevent-printing-pdf-forms-in- acrobat-8/

     

    But you never can prevent users from saving a form.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 2, 2012 7:11 AM   in reply to Zayed_Stell

    Please read the article under the link I posted before.

    There you'll get all details of how to prevent the printing and a sample form you can work with.

    Keep in mind that it isn't possible to prevent the saving, this only works for printing, submitting and data connections.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 3, 2012 1:09 AM   in reply to Zayed_Stell

    What version of Designer do you use?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 3, 2012 1:39 AM   in reply to Zayed_Stell

    Ok,

     

    than you need to add the validate element under the <config> tag as it doesn't exist by default.

     

    Before:

    <config xmlns="http://www.xfa.org/schema/xci/3.0/">
       <agent name="designer">
          <!--  [0..n]  -->
          <destination>pdf</destination>
          <pdf>
             <!--  [0..n]  -->
             <fontInfo/>
          </pdf>
       </agent>
       <present>
          <!--  [0..n]  -->
          <pdf>
             <!--  [0..n]  -->
             <fontInfo/>
             <version>1.7</version>
             <adobeExtensionLevel>5</adobeExtensionLevel>
          </pdf>
          <xdp>
             <packets>*</packets>
          </xdp>
       </present>
    </config>
    

     

    After:

    <config xmlns="http://www.xfa.org/schema/xci/3.0/">
       <agent name="designer">
          <!--  [0..n]  -->
          <destination>pdf</destination>
          <pdf>
             <!--  [0..n]  -->
             <fontInfo/>
          </pdf>
       </agent>
       <present>
          <!--  [0..n]  -->
          <pdf>
             <!--  [0..n]  -->
             <fontInfo/>
             <version>1.7</version>
             <adobeExtensionLevel>5</adobeExtensionLevel>
          </pdf>
          <xdp>
             <packets>*</packets>
          </xdp>
       </present>
       <!-- This is the validate element to prevent printing, when mandatory fields are empty -->
       <acrobat>
          <validate>prePrint</validate>
       </acrobat>
    </config>
    
     
    |
    Mark as:
  • Currently Being Moderated
    Jul 3, 2012 2:41 AM   in reply to Zayed_Stell

    Go to the XML-Source and look for the <config> tag and add this snippet.

     

    <acrobat>
          <validate>prePrint</validate>
    </acrobat>

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 3, 2012 4:36 AM   in reply to Zayed_Stell

    Hi,

     

    TeamViewer is ok, but not at the moment.

    Do you have time this evening at around 19:00?

    Or can you share your form somewhere and post a link here?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 3, 2012 4:44 AM   in reply to Zayed_Stell

    Keine Ursache.

    Bis morgen dann!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points