Exporting / Printing selected layer of pdf file

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am

Exporting / Printing selected layer of pdf file

Post by MartinCS »

Hi Tracker team,

is there a possibility to select a certain layer of a pdf file and export / print it with the original page size of the pdf file container programmatically? With other words, I do have a file which contains several layers. I would like to hide all layers except one specific layer and print it using the PDF-XChange 4.0 ptiner driver.

Thank you for your support!


Cheers,
Martin
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Exporting / Printing selected layer of pdf file

Post by Stefan - PDF-XChange »

Hi Martin,

I do not think there's currently any way to achieve this via code, but will double check with my colleagues from the dev team, and let you know.

Best,
Stefan
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am

Re: Exporting / Printing selected layer of pdf file

Post by MartinCS »

Hi Stefan,

i highly appreciate your help and i'm still hoping to receive a positive feedback from your colleagues.


Thanks,
Martin
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Exporting / Printing selected layer of pdf file

Post by Stefan - PDF-XChange »

Hi Martin,

Thanks for the kind words! We will reply as soon as possible!

Cheers,
Stefan
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Exporting / Printing selected layer of pdf file

Post by Vasyl - PDF-XChange »

Hi Martin
I would like to hide all layers except one specific layer and print it using the PDF-XChange 4.0 ptiner driver.
You can hide/show layers by JavaScript. Look to Adobe's JS Reference for Acrobat. Example:

Code: Select all

function ToggleOCGsForDoc(doc)
{
var ocgArray = doc.getOCGs();
for (var i=0; i < ocgArray.length; i++) 
ocgArray[i].state = !ocgArray[i].state;
}
ToggleOCGsForDoc(this);
Use RunJavaScript function from interface of ActiveX Control..

Best
Regards.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.