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.
does this only happen with VBA?the standard Publish to PDF - does the conversion work ok?
this is only with vba but not with standard export or save as or publish to pdf dialog boxes. they do not resample to resolution.
maybe several files for example - VBA code (gms), CDR and result in PDF?
almost 200 cdr daily to convert to pdf with different downsampling resolutions and output color type ie cmyk, greyscale, native
can you post the full macro code?
Just add these codes at bottomCorelScriptTools.BeginWaitCursorActiveDocument.PublishToPDF FilePath & "\" & FileName & ".pdf"CorelScriptTools.EndWaitCursorMsgBox "File " & FileName & ".pdf" & " saved successfully.", , "Success.", vbInformation, "PDF Maker."
Try my macro
although it has rigid resolution parameters
Link broken
???
Got it now. I will test it today if it works for me. Thanks