7 Replies Latest reply on Aug 30, 2011 11:42 AM by G0V.

    flatten pdf in one scoop?

    lvo811

      Hi

      I'm new to cf, and wanting to flatten a form created from Acrobat. I tried to combine the code so it writes out the file once, but ran into the problem that cfpdfform doesn't flatten the file unless I use cfpdf. But cfpdf doesn't prefill the pdf textfields. I'm sure there's a way, any help or suggestions is greatly appreciated. Thanks in advance.

       

       

       

      <cfpdfform action="populate" source="interactiveform.pdf" destination="interactiveform_temp.pdf"  overwrite = "true" >
              <cfpdfformparam name="company" value="ACME INC" />
              <cfpdfformparam name="address" value="123 Main St." />
      </cfpdfform>

       

       

      <cfpdf action="write" source="interactiveform_temp.pdf" destination="interactiveform_flatten.pdf" flatten="yes"  overwrite = "true" >
      </cfpdf>

        • 1. Re: flatten pdf in one scoop?
          -==cfSearching==- Level 4

          I tried to combine the code so it writes out the

          file once, but ran into the problem that cfpdfform doesn't

          flatten the file unless I use cfpdf. But cfpdf doesn't

          prefill the pdf textfields.

           

          Yes, you must use two steps to flatten forms. First populate them with cfpdfform and second flatten them with cfpdf.

           

          BUT ... cfpdf does not flatten livecycle forms. Based on what you have described, that is most likely what you are using.  Unfortunately, if you want to flatten livecycle forms you must use livecycle. ie You cannot use ColdFusion for this.

           

          -Leigh

          • 2. Re: flatten pdf in one scoop?
            G0V. Level 1

            "BUT ... cfpdf does not flatten livecycle forms."

             

            I'd like to mention that this is not entirely correct.

            I'm able to populate pdf forms created in LiveCycle Designer (if by 'livecycle' you mean the designer program)

             

            However, it's unclear why, dynamicly inserted images do show up once the pdf form is populated with cfpdfform action="populate" but disapear once flattened (in the 2nd step) with cfpdf action="write" flatten="yes"

             

             

            Any ideas anyone?  Or is this blocked on purpopse by Adobe?

            • 3. Re: flatten pdf in one scoop?
              -==cfSearching==- Level 4

              "BUT ... cfpdf does not flatten livecycle forms."

               

              I'd like to mention that this is not entirely correct.

              I'm able to populate pdf forms created in LiveCycle

              Designer (if by 'livecycle' you mean the designer program)

               

              Populating is not the same thing as flattening. AFAIK the restrictions are only on flattening liveCycle forms.

               

              http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_p-q_02.html

              "You cannot use the cfpdf tag to flatten forms created in Adobe LiveCycle Designer ES.

              "

              • 4. Re: flatten pdf in one scoop?
                -==cfSearching==- Level 4

                You cannot use the cfpdf tag to flatten forms created in
                Adobe LiveCycle Designer ES.

                 

                It is more accurate to say it is about the form type.  CFPDF will flatten static forms, just not LiveCycle's xfa forms.

                 

                Or is this blocked on purpopse by Adobe?

                 

                Yes, it is deliberate.  I believe it is throttled for the usual licensing reasons.

                • 5. Re: flatten pdf in one scoop?
                  G0V. Level 1

                  There's always another way.  I could use cfprint and target 'Adobe PDF' printer to force save the pdf form -including dynamicly injected images- to a static pdf file. If only I knew how to successfully print to the Adobe PDF printer with cfprint.  Printing PDF forms to Adobe PDF with cfprint seems to cause CF9 to hang.

                  • 6. Re: flatten pdf in one scoop?
                    -==cfSearching==- Level 4

                    Printing PDF forms to Adobe PDF with

                    cfprint seems to cause CF9 to hang.

                     

                    Yeah I recall someone talking about print drivers as an alternative. But they were referring to command line printing. I have not heard of any success stories involving cfprint myself.

                    • 7. Re: flatten pdf in one scoop?
                      G0V. Level 1

                      Indeed. Command line printing FTW!

                       

                      Thanks for your advice :-)