I have been playing around with scripts in CorelDraw and this is one I found pretty useful
Say you have 10 Pages but you need each page to be induvidually exported, all you need to do is add this macro/script save your file as a.cdr file and run it, the script exports the PDFs per page and even uses the page name as the.pdf file name where the .cdr file is saved. So no more publish to pdf and going one by one.
Just copy and paste the macro down below.
Sub PublishAllPagesAsPDF() Dim doc As Document Dim pg As Page Dim fullPath As String Dim exportPath As String Dim pos As Long Dim FileName As String Dim outputPath As String
Set doc = ActiveDocument
fullPath = doc.FullFileName If fullPath = "" Then MsgBox "Please save your document first!", vbExclamation Exit Sub End If
pos = InStrRev(fullPath, "\") If pos > 0 Then exportPath = Left(fullPath, pos) Else MsgBox "Unable to determine folder path.", vbCritical Exit Sub End If
' Loop through all pages For Each pg In doc.Pages pg.Activate
' Get safe file name from page name or fallback FileName = Trim(pg.Name) If FileName = "" Then FileName = "Page_" & pg.Index
' Sanitize file name FileName = Replace(FileName, "\", "_") FileName = Replace(FileName, "/", "_") FileName = Replace(FileName, ":", "_") FileName = Replace(FileName, "*", "_") FileName = Replace(FileName, "?", "_") FileName = Replace(FileName, """", "_") FileName = Replace(FileName, "<", "_") FileName = Replace(FileName, ">", "_") FileName = Replace(FileName, "|", "_")
outputPath = exportPath & FileName & ".pdf"
' Set PDF settings for current page With doc.PDFSettings .PageRange = CStr(pg.Index) ' Set export to only this page .PublishRange = 1 ' 1 = use PageRange .Author = "Jaco Coetzee" .EmbedFonts = True ' Add any additional settings here if needed End With
' Export the page doc.PublishToPDF outputPath Next pg
MsgBox "All pages have been exported to PDF in:" & vbCrLf & exportPath, vbInformationEnd Sub