2 Replies Latest reply: Feb 3, 2012 6:17 AM by JADarnell RSS

    Downsampling to 150

    JADarnell Community Member

      Hello all:

       

         I've built a small plugin that creates PDFs out of InDesign documents.  I set the following export options just prior to generating the PDF (sorry about the table format--the forum editor is doing that--not me):

       

       


      InterfacePtr<IPDFExportPrefs> CmdExportPrefs(PrintOnePDFCommand, UseDefaultIID());

       


      CmdExportPrefs -> SetAddStructure(kFalse);      //  Tagged PDF

      CmdExportPrefs -> SetIncludeSlug(  kTrue);

      CmdExportPrefs -> SetUseDocumentBleed(kFalse);

       


      CmdExportPrefs -> SetPDFExMarkLineWeight(  .25);

      CmdExportPrefs -> SetPDFExPrinterMarksOffset(   21);//  .29 inches roughly equals 21

      CmdExportPrefs -> SetPDFExSubsetFontsThreshold(100);//  100% of subsetted fonts are embedded

       


      CmdExportPrefs -> SetPDFExBleedTop(          9);

      CmdExportPrefs -> SetPDFExBleedBottom(       9);

       


      CmdExportPrefs -> SetPDFExBleedInside(       9);

      CmdExportPrefs -> SetPDFExBleedOutside(      9);

       


      CmdExportPrefs -> SetPDFExAcrobatCompatibilityLevel(             IPDFExportPrefs::kPDFVersion16);

      CmdExportPrefs -> SetPDFExBleed(                                IPDFExportPrefs::kExportBleedON);

       


      CmdExportPrefs -> SetPDFExColorBars(                       IPDFExportPrefs::kExportColorBarsOFF);

       


      CmdExportPrefs -> SetPDFExCompressColorImages(IPDFExportPrefs::kExportCompressImagesAutoLZWJPEGHigh);   //  Quality?

      CmdExportPrefs -> SetPDFExCompressGrayImages( IPDFExportPrefs::kExportCompressImagesAutoLZWJPEGHigh);   //  Quality?

       


      CmdExportPrefs -> SetPDFExColorSpace(             IPDFExportPrefs::kExportPDFColorSpacePassthru);

       

       


      CmdExportPrefs -> SetPDFExCompressLineArtAndText(  IPDFExportPrefs::kExportCompressLineArtAndTextON);

      CmdExportPrefs -> SetPDFExCompressMonoImages( IPDFExportPrefs::kExportCompressImagesCCITTGroup4);   //  Quality?

       


      CmdExportPrefs -> SetPDFExCropMarks(                        IPDFExportPrefs::kExportCropMarksON);

       


      CmdExportPrefs -> SetPDFExDisallowImageCrop(       IPDFExportPrefs::kExportDisallowImageCropOFF);   //  Crop image to frame

       


      CmdExportPrefs -> SetPDFExIncludeICCProfiles(     IPDFExportPrefs::kExportIncludeICCProfilesOFF);

      CmdExportPrefs -> SetPDFExPageInfo(                          IPDFExportPrefs::kExportPageInfoON);

       


      CmdExportPrefs -> SetPDFExReaderSpreads(               IPDFExportPrefs::kExportReaderSpreadsOFF);

      CmdExportPrefs -> SetPDFExRegistrationMarks(       IPDFExportPrefs::kExportRegistrationMarksOFF);

      CmdExportPrefs -> SetPDFExThumbnails(                     IPDFExportPrefs::kExportThumbnailsOFF);

       


      CmdExportPrefs -> SetPDFExLinearized(                     IPDFExportPrefs::kExportLinearizedOFF);

       



      // process kSetPDFExportPrefsCmdBoss to change current settings


      InterfacePtr<ICommand> SetPDFExportPrefsCmd(CmdUtils::CreateCommand(kSetPDFExportPrefsCmdBoss));


      if (SetPDFExportPrefsCmd == nil)


      {



      ASSERT_FAIL("Failed to get setPDFExportPrefsCmd");



      break;


      }


      InterfacePtr<IPDFExportPrefs> pdfExportPrefs(SetPDFExportPrefsCmd, UseDefaultIID());


      if (pdfExportPrefs == nil)


      {



      ASSERT_FAIL("Failed to get IPDFExportPrefs/pdfExportPrefs");



      break;


      }


      pdfExportPrefs -> CopyPrefs(CmdExportPrefs);


      CmdUtils::ProcessCommand(SetPDFExportPrefsCmd);

       

      With this set of options, some of our images are getting downsampled to 150 dpi when they otherwise have decent resolution.

       

      I removed all the compression lines, for example:

       


      CmdExportPrefs -> SetCompressColorAbove(   300);//Color:  300JPEG 

      CmdExportPrefs -> SetCompressGrayAbove(    300);//Grayscale 300JPEG

      CmdExportPrefs -> SetCompressMonochromeAbove( 1200);//  1 bit 1200 CCITT

       


      CmdExportPrefs -> SetPDFExCompressColorImages(IPDFExportPrefs::kExportCompressImagesAutoLZWJPEGHigh);   //  Quality?

      CmdExportPrefs -> SetPDFExCompressGrayImages( IPDFExportPrefs::kExportCompressImagesAutoLZWJPEGHigh);   //  Quality?

       


      CmdExportPrefs -> SetPDFExCompressLineArtAndText(  IPDFExportPrefs::kExportCompressLineArtAndTextON);

      CmdExportPrefs -> SetPDFExCompressMonoImages( IPDFExportPrefs::kExportCompressImagesCCITTGroup4);   //  Quality?

      Suddenly all of our images were downsampled to 150 dpi.  What's making that happen?  How can I stop it?

       

      TIA!

       

      John

       

       

       

       

       

       

       

       

       

       

       


        • 1. Re: Downsampling to 150
          Norio Kawamura Community Member

          Do you try the Image sampling options of IPDFExportPrefs?

          SetPDFExSampleColorImages, SetPDFExSampleGrayImages, SetPDFExSampleMonoImages,

          SetPDFExSampleColorImagesXRes. etc.

          • 2. Re: Downsampling to 150
            JADarnell Community Member

            Not originally, but later on as I studied IPDFExports.h and found them.  Interestingly enough they did little.

             

            What finally seemed to fix the problem was a combination of the code you suggest and setting the compression member functions to high.  Here’s the code:

             

                  CmdExportPrefs -> SetPDFExSampleColorImages(IPDFExportPrefs::kExportSampleImagesByBicubicDownsampling);

                  CmdExportPrefs -> SetPDFExSampleColorImagesXRes((int32) 300);

                  CmdExportPrefs -> SetPDFExSampleColorImagesYRes((int32) 300);

             

                  CmdExportPrefs -> SetPDFExSampleGrayImages(IPDFExportPrefs::kExportSampleImagesByBicubicDownsampling);

                  CmdExportPrefs -> SetPDFExSampleGrayImagesXRes((int32)  300);

                  CmdExportPrefs -> SetPDFExSampleGrayImagesYRes((int32)  300);

             

                  CmdExportPrefs -> SetPDFExSampleMonoImages(IPDFExportPrefs::kExportSampleImagesByBicubicDownsampling);

                  CmdExportPrefs -> SetPDFExSampleMonoImagesXRes((int32) 1200);

                  CmdExportPrefs -> SetPDFExSampleMonoImagesYRes((int32) 1200);

             

                  CmdExportPrefs -> SetCompressColorAbove(       300);    //Color:  300JPEG

                  CmdExportPrefs -> SetCompressGrayAbove(        300);    //Grayscale 300JPEG

                  CmdExportPrefs -> SetCompressMonochromeAbove( 1200);    //  1 bit 1200 CCITT

             

                  CmdExportPrefs -> SetPDFExCompressColorImages(IPDFExportPrefs::kExportCompressImagesAutoLZWJPEGHigh);   //  Quality?

                  CmdExportPrefs -> SetPDFExCompressGrayImages( IPDFExportPrefs::kExportCompressImagesAutoLZWJPEGHigh);   //  Quality?

             

                  CmdExportPrefs -> SetPDFExCompressLineArtAndText(  IPDFExportPrefs::kExportCompressLineArtAndTextON);

                  CmdExportPrefs -> SetPDFExCompressMonoImages(     IPDFExportPrefs::kExportCompressImagesCCITTGroup4);   //  Quality?

             

            Thanks for the information, Norio.

             

            R,

            John