4 Replies Latest reply on Apr 4, 2012 1:12 PM by Muppet Mark

    downsample pdfs

    bobhopfner

      I have a 24"x36" poster with a 300DPI background image wieghing in at around 180. If I export a PDF it comes out at 300MB. I have no image compression or downsampling - yet.

       

       

       

      If I scale the image down to 50% and add:

       

          colorBitmapSampling = Sampling.BICUBIC_DOWNSAMPLE;
          colorBitmapSamplingDPI = 300;

       

       

      to my pdf export, I should get a smaller PDF correct? I don't really want to jpeg the images - what other tricks can I use to keep the file size down? I think I have all the pdf export parameters but not sure

       

      thanks,

      Bob

       

      function myPDFExport()

      {

              //Basic PDF output options.

              pageRange = PageRange.allPages;

              acrobatCompatibility = AcrobatCompatibility.acrobat8;

              exportGuidesAndGrids = false;

              exportLayers = false;

              exportNonPrintingObjects = false;

              exportReaderSpreads = false;

              generateThumbnails = false;

             

              try

              {

                  ignoreSpreadOverrides = false;

              }

              catch(e) {}

             

              includeBookmarks = false;

              includeHyperlinks = false;

              includeICCProfiles = true;

              includeSlugWithPDF = true;

              includeStructure = false;

              interactiveElementsOption = InteractiveElementsOptions.doNotInclude;

             

              //Setting subsetFontsBelow to zero disallows font subsetting;

              //set subsetFontsBelow to some other value to use font subsetting.

              subsetFontsBelow = 0;

       

              //Bitmap compression/sampling/quality options.

              colorBitmapCompression = BitmapCompression.none;

              //colorBitmapQuality = CompressionQuality.eightBit;

             

              //colorBitmapSampling = Sampling.none;

              colorBitmapSampling = Sampling.BICUBIC_DOWNSAMPLE;

              colorBitmapSamplingDPI = 300;

       

              //thresholdToCompressColor is not needed in this example.

              //colorBitmapSamplingDPI is not needed when colorBitmapSampling

              //is set to none.

              grayscaleBitmapCompression = BitmapCompression.none;

              //grayscaleBitmapQuality = CompressionQuality.eightBit;

              grayscaleBitmapSampling = Sampling.none;

              //thresholdToCompressGray is not needed in this example.

              //grayscaleBitmapSamplingDPI is not needed when grayscaleBitmapSampling

              //is set to none.

              monochromeBitmapCompression = BitmapCompression.none;

              monochromeBitmapSampling = Sampling.none;

       

              //thresholdToCompressMonochrome is not needed in this example.

              //monochromeBitmapSamplingDPI is not needed when

              //monochromeBitmapSampling is set to none.

              //

              //Other compression options.

              compressionType = PDFCompressionType.compressNone;

              compressTextAndLineArt = true;

              cropImagesToFrames = true;

              optimizePDF = true;

             

             

       

              colorTileSize = 128;

              grayTileSize = 128;

              cropMarks = false;

              omitBitmaps = false;

              omitEPS = false;

              omitPDF = false;

              pageInformationMarks = false;

              pdfColorSpace = PDFColorSpace.unchangedColorSpace;

              //Default mark type.

              pdfMarkType = 1147563124;

              printerMarkWeight = PDFMarkWeight.p125pt;

              registrationMarks = false;

        • 1. Re: downsample pdfs
          absqua Level 4

          Yes, if you're scaling, you definitely ought to downsample images during export. I don't know your reasons for avoiding jpeg compression, but that would give you the greatest reduction in file size. (Maximum quality jpeg compression is not  visually detectable to me at all, except maybe in large, subtle gradations.) If you're not going to use jpeg compression on the images, I really don't see any reason you wouldn't at least use zip compression. You can also use

           

          compressionType = PDFCompressionType.COMPRESS_OBJECTS
          

           

          to compress the pdf itself; I can't say I understand exactly what that does, but I've never run into a problem with it. You could also exclude ICC profiles, depending on the needs of whoever is using the file downstream.

           

          By the way, it looks to me like your function is just setting a bunch of global variables. Maybe there was a

           

          with (app.pdfExportPreferences) {
          

           

          in there at some point?

           

          Jeff

          • 2. Re: downsample pdfs
            bobhopfner Level 1

            Are there any performance issues with Zip compression? I would hate to bog down the rip at the other end by having it uncompress all the image files on that end. I am worried about image compression and artifacts in gradients and that is exactly why I am trying to avoid jpeg compression. Perhaps Maximum isn't as drastic as I feared.

             

             

            I'll test it all and see what happens. I will check on the missing "with" statement too. That might be my problem.

             

            thanks!,

            Bob

            • 3. Re: downsample pdfs
              absqua Level 4

              bobhopfner wrote:

               

              Are there any performance issues with Zip compression? I would hate to bog down the rip at the other end by having it uncompress all the image files on that end.

               

              I wouldn't worry about that at all. The benefits of lighter files throughout the process far outweigh a little bit of time spent decompressing images in pdfs. Most pdf-based print workflow systems (Prinergy, etc.) will zip-compress the images when the pdfs are brought into the system anyway.

               

              I will check on the missing "with" statement too. That might be my problem.

               

              See Harbs's comment in a nearby thread; better than with would be a construction like:

               

              app.pdfExportPreferences.properties = {
                  pageRange: PageRange.allPages,
                  acrobatCompatibility: AcrobatCompatibility.acrobat8,
                  exportGuidesAndGrids: false,
                  exportLayers: false,
                  exportNonPrintingObjects: false,
                  exportReaderSpreads: false,
                  generateThumbnails: false,
                  // ...
              }
              
              • 4. Re: downsample pdfs
                Muppet Mark Level 5

                Or use a saved preset? It has the same ease in script as the GUI