7 Replies Latest reply on Jun 4, 2014 5:02 AM by ctreeves

    cfpdf optimize

    ctreeves Level 1

      I am uploading pdf files to our server and want to save space.  I am trying to use cfpdf to optimize the file size.  The one I am testing on is 1.25MB, so it's not a big file.  When I reduce it using desktop Acrobat it takes less than 1 second.  When I use Coldfusion it times out after several minutes.

       

      The file is first uploaded to it's own directory, then I use this to try to reduce it.

       

      <cfpdf

          action = "optimize"

          source = "H:\Inetpub\Wwwroot\MySite.com\newsletters\files\#Section#\#issue#.pdf" 

          algo = "bilinear" />

       

      I'm sure it's something I've done wrong, please advise.

        • 1. Re: cfpdf optimize
          ctreeves Level 1

          Bump 

          • 2. Re: cfpdf optimize
            BKBK Adobe Community Professional & MVP

            It should take seconds, not minutes. When I tested, using the following code on a 2MB PDF, it took 8 seconds.

             

            <cfpdf

                action = "optimize"

                source =  "C:\ColdFusion11\cfusion\wwwroot\workspace\cfTest\pdf\myDoc.pdf"

                algo = "bilinear"

                pages = "*"

                destination =  "C:\ColdFusion11\cfusion\wwwroot\workspace\cfTest\pdf\myDoc_optimized.pdf" 

                overwrite = "true">

               Done optimizing.

            • 3. Re: cfpdf optimize
              ctreeves Level 1

              Thank you, I tried your code to see if I could reduce one file directly on the server as compared to while I am uploading it.  The pdf is not protected and does have many images embedded.

               

              I get this error:

              An error occurred during OPTIMIZE operation in the cfpdf tag.

              Error: com.adobe.internal.pdftoolkit.core.exceptions.PDFCosParseException: Undefined filter - JPXDecode
              • 4. Re: cfpdf optimize
                BKBK Adobe Community Professional & MVP

                Your Coldfusion version?

                • 5. Re: cfpdf optimize
                  ctreeves Level 1

                  Version: 9,0,0,251028

                  • 6. Re: cfpdf optimize
                    BKBK Adobe Community Professional & MVP

                    ctreeves wrote:

                     

                    Thank you, I tried your code to see if I could reduce one file directly on the server as compared to while I am uploading it.  The pdf is not protected and does have many images embedded.

                     

                    I get this error:

                    An error occurred during OPTIMIZE operation in the cfpdf tag.

                    Error: com.adobe.internal.pdftoolkit.core.exceptions.PDFCosParseException: Undefined filter - JPXDecode

                    In my opinion, you have found a bug in ColdFusion 9. You should create a bug report, attaching the PDF file to it.

                    • 7. Re: cfpdf optimize
                      ctreeves Level 1

                      Thank you, I submitted a bug.  I may be able to migrate to CF10 in the next 6 months to a year, but this is disappointing for now.  Maybe they'll fix my bug today? 

                       

                      I appreciate your help!