I’m encountering an issue with publishing PDFs using VBA. Despite having bitmaps in CorelDRAW with lower resolutions, the published PDF is converting all bitmaps to a higher resolution. How can I resolve this problem?
With ActiveDocument.PDFSettings .PublishRange = 1 ' CdrPDFVBA.pdfCurrentPage .PageRange = "1" .Author = "CorelDraw" .Subject = "" .Keywords = "" .BitmapCompression = 2 ' CdrPDFVBA.pdfJPEG .JPEGQualityFactor = 2 .TextAsCurves = True .EmbedFonts = True .EmbedBaseFonts = True .TrueTypeToType1 = True .SubsetFonts = True .SubsetPct = 80 .CompressText = True .Encoding = 1 ' CdrPDFVBA.pdfBinary .DownsampleColor = True .DownsampleGray = True .DownsampleMono = True .ColorResolution = 1200 'Resolution .MonoResolution = 2400 'Resolution * 2 .GrayResolution = 1200 ' Resolution .Hyperlinks = False .Bookmarks = False .Thumbnails = False .Startup = 0 ' CdrPDFVBA.pdfPageOnly .ComplexFillsAsBitmaps = False .Overprints = True .Halftones = False .MaintainOPILinks = False .FountainSteps = 999 .EPSAs = 0 ' CdrPDFVBA.pdfPostscript .pdfVersion = 0 ' CdrPDFVBA.pdfVersion12 .IncludeBleed = False .Bleed = 31750 .Linearize = False .CropMarks = False .RegistrationMarks = False .DensitometerScales = False .FileInformation = False .ColorMode = ColorSpace ' CdrPDFVBA.pdfNative '.UseColorProfile = True .ColorProfile = 1 ' CdrPDFVBA.pdfSeparationProfile .EmbedFilename = FileNameText.text '"" .EmbedFile = False .JP2QualityFactor = 2 .TextExportMode = 0 ' CdrPDFVBA.pdfTextAsUnicode .PrintPermissions = 0 ' CdrPDFVBA.pdfPrintPermissionNone .EditPermissions = 0 ' CdrPDFVBA.pdfEditPermissionNone .ContentCopyingAllowed = False .OpenPassword = "" .PermissionPassword = "" .EncryptType = 2 ' CdrPDFVBA.pdfEncryptTypeAES .OutputSpotColorsAs = OutputSpace ' CdrPDFVBA.pdfSpotAsSpot .OverprintBlackLimit = 100 .ProtectedTextAsCurves = True End With
understand these parameters and correct them to the ones you need
.ColorResolution = 1200 'Resolution.MonoResolution = 2400 'Resolution * 2.GrayResolution = 1200 ' Resolution
This is the DPI for color, gray and monochrome rasters
I understand it.
Those were defined for downsampling purposes but not for resampling purposes. Downsampling means if the image resolution is greater than "Resolution" then downsample to the resolution else unchanged.
although you have designed such an excellent UI.
Can I ask for your file - where such amazing things happen - for analysis? Just a few raster samples in the document that change the resolution from 72 to 300 as a result of the PDF conversion.
https://file.io/0ItdM05RYfrA look at the source and published one. open the pdf in corel draw to see the new resolution
however... if you select not As Is(= EDITING in Preferences), but a CMYK or RGB model, then the resolution changes... apparently this is a VBA or CorelDRAW error... the macro uses the same pdfVBA parameters /// tested in 2018 and 2024 version
yes it is the problem with VBA and CorelDraw