![]() |
#1
|
||||
|
||||
![]()
Hi Everyone,
I'm wondering if someone can help me out here. I have my own script that I've made for exporting PDF's... works great. Now... I have a need to have pages in a Corel drawing that doesn't print, or show in the PDF output... for which I turn off the print setting in the object manager for the appropriate layers. Again... this is all fine. Where I run into the problem is that if I have two pages, and the second page has the items I don't want to appear in the PDF... the page still exists in the PDF... just with nothing in it. Technically the page does have things on it, they just don't appear on a printable layer. Is there a way to make the PDF ignore a page without any "printable" data on it? Any suggestions would be appreciated. Thanks! |
#2
|
||||
|
||||
![]()
Here is what I came up with, basically you look at each of the layers on a page and if the page has no printable layer your exclude it.
Code:
Sub CreatePDFwithPrintablePages() With ActiveDocument.PDFSettings .PublishRange = 3 'Prints a PageRange .PageRange = GetPrintablePages 'Printable pages returned from function End With ActiveDocument.PublishToPDF "D:\Temp\MyPDF.pdf" End Sub Private Function GetPrintablePages() As String Dim p As Page Dim strPrintablePages For Each p In ActiveDocument.Pages If SearchForPrintablePages(p) Then strPrintablePages = strPrintablePages & p.Index & "," Next p GetPrintablePages = Left(strPrintablePages, Len(strPrintablePages) - 1) 'Trim off the last comma End Function Private Function SearchForPrintablePages(ByVal p As Page) As Boolean Dim l As Layer For Each l In p.Layers If l.Printable Then SearchForPrintablePages = True Exit Function End If Next l SearchForPrintablePages = False End Function Hopefully it gets you started and shows it is possible, -Shelby |
#3
|
||||
|
||||
![]()
Much appreciated Sir! I'll try it out!
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fill in the blank (TextRange) | runflacruiser | CorelDRAW/Corel DESIGNER VBA | 5 | 18-05-2011 10:54 |
Remove blank space in Paragraph text | runflacruiser | CorelDRAW/Corel DESIGNER VBA | 8 | 20-10-2010 19:01 |
Convert Paragraph to Artistic - error on blank Paragraph Text Field | gorgo2 | Macros/Add-ons | 3 | 14-09-2010 06:53 |
Macro - loading a blank template file *.cdt for Grahic and Text styles | gorgo2 | Macros/Add-ons | 5 | 28-04-2010 00:25 |
How I can create blank GMS in CDX3? | geHucKa | CorelDRAW/Corel DESIGNER VBA | 2 | 10-04-2006 17:16 |