Print a PDF to PDF via SDK SOLVED
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Print a PDF to PDF via SDK
Hi Support,
Having a PDF document with some security restrictions like "no page extraction", but "allow printing", I'm looking for a way to print a PDF to PDF - as the resulting PDF will be without restrictions.
I can do this in EU Editor, by printing the document via "PDF-XChange Lite Printer" - as it gets installed along with EU Editor. Actually, the same can be achieved if the selected PDF printer is any PDF virtual printer (like Adobe PDF Printer).
Is there a way to print a PDF to PDF using SDK (to achieve the above), silently (so no print dialog), just by specifying the resulting file name? And of course, without having the "PDF-XChange Lite Printer" (or any) installed.
-žarko
Having a PDF document with some security restrictions like "no page extraction", but "allow printing", I'm looking for a way to print a PDF to PDF - as the resulting PDF will be without restrictions.
I can do this in EU Editor, by printing the document via "PDF-XChange Lite Printer" - as it gets installed along with EU Editor. Actually, the same can be achieved if the selected PDF printer is any PDF virtual printer (like Adobe PDF Printer).
Is there a way to print a PDF to PDF using SDK (to achieve the above), silently (so no print dialog), just by specifying the resulting file name? And of course, without having the "PDF-XChange Lite Printer" (or any) installed.
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Print a PDF to PDF via SDK
Hello zarkogajic,
There is a sample in the FullDemo application on how to use the Print operation via the Print Form. You can then set the needed settings and then extract the needed code piece and use the op.document.printPages operation.
Cheers,
Alex
There is a sample in the FullDemo application on how to use the Print operation via the Print Form. You can then set the needed settings and then extract the needed code piece and use the op.document.printPages operation.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Print a PDF to PDF via SDK
Hi Alex,
Thanks. But for "op.document.printPages" I still need a virtual PDF printer installed, correct?
I was hoping for something like : use op.document.printPages to create a new CoreDocument .
So, in the similar way how, for example, the SDK, via converters, can open a DOC and convert (/print) to PDF.
Btw, "Input" and "Output" parameters are used or not for this operation?
-žarko
Thanks. But for "op.document.printPages" I still need a virtual PDF printer installed, correct?
I was hoping for something like : use op.document.printPages to create a new CoreDocument .
So, in the similar way how, for example, the SDK, via converters, can open a DOC and convert (/print) to PDF.
Btw, "Input" and "Output" parameters are used or not for this operation?
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Print a PDF to PDF via SDK
Hello zarkogajic,
The FullDemo application has a sample form that has printer choose dropdown and you can look at all of the parameters there also.
Cheers,
Alex
The FullDemo application has a sample form that has printer choose dropdown and you can look at all of the parameters there also.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Print a PDF to PDF via SDK
HI Alex,
Thanks. Yes, I see that,
I'm asking for something else... note that I do not want to pick the installed printer (as I might not have one)
I'm looking for a "converter" that knows how to *print* a PDF to PDF.
-žarko
Thanks. Yes, I see that,
I'm asking for something else... note that I do not want to pick the installed printer (as I might not have one)
I'm looking for a "converter" that knows how to *print* a PDF to PDF.
-žarko
- Vasyl-Tracker Dev Team
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: Print a PDF to PDF via SDK
Hi zarko.
Unfortunately, there is no such simple PDF-to-PDF_without_restrictions converter. And to be clear - it is against to PDF-security to have such thing in SDK.
Cheers.
Unfortunately, there is no such simple PDF-to-PDF_without_restrictions converter. And to be clear - it is against to PDF-security to have such thing in SDK.
Cheers.
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Print a PDF to PDF via SDK
Hi Vasyl,
Thanks. Yes, I know what I'm up to is kind of against the security .
But, if a document allows printing, and I can print it using "pdfx lite printer" (or any pdf printer) - then is that apprach also against what should be disallowed?
-žarko
Thanks. Yes, I know what I'm up to is kind of against the security .
But, if a document allows printing, and I can print it using "pdfx lite printer" (or any pdf printer) - then is that apprach also against what should be disallowed?
-žarko
- Vasyl-Tracker Dev Team
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: Print a PDF to PDF via SDK
Technically it is impossible to prevent using the virtual printers by the app. From the app's prospective such printers look like real ones.
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Print a PDF to PDF via SDK
Hi Vasyl,
Of course, I do agree with what you are saying.
However, the entire thing depends on the point of view and perspective
PDF Printers are nothing but applications knowing how to open and manipulate PDF documents (and of course other supported formats).
Once a PDF Printer receives a PDF for input, to create a new PDF ("printed version"), the printing app must extract pages and stuff from the pdf received. So, a pdf printer app also does not really obey the security settings and does extract pages (content from it) to create a new PDF.
By a quick look in Help, I'm guessing something can be achieved with IIXC_Page and related...
-žarko
Of course, I do agree with what you are saying.
However, the entire thing depends on the point of view and perspective
PDF Printers are nothing but applications knowing how to open and manipulate PDF documents (and of course other supported formats).
Once a PDF Printer receives a PDF for input, to create a new PDF ("printed version"), the printing app must extract pages and stuff from the pdf received. So, a pdf printer app also does not really obey the security settings and does extract pages (content from it) to create a new PDF.
Is there a complex one?there is no such simple PDF-to-PDF_without_restrictions converter.
By a quick look in Help, I'm guessing something can be achieved with IIXC_Page and related...
-žarko
- Vasyl-Tracker Dev Team
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: Print a PDF to PDF via SDK
Hi Zarko.
The same is for real printers too. And only PostScript-printer may receive the native PostScript content in case when printing app is able to convert document to postscript format (we haven't such option).
- additionally you need to copy bookmarks tree. When there are bookmarks that relates to named-destinations - you also need to handle corresponding named tree.
- also biggest problem is - it seems impossible to copy existing AcroForm in such way. Because it is too complex stuff in common case.
Cheers.
That's incorrect. Actually the PDF-printer only receive printing commands (GDI) like:Once a PDF Printer receives a PDF for input, to create a new PDF...
Code: Select all
StartDoc
StartPage
DrawText(text, x, y... )
MoveTo(x, y... )
LineTo(x, y... )
...
EndPage
...
EndDoc
Yes, you may 'convert' all pages from source doc to new doc via something like:I'm guessing something can be achieved with IIXC_Page and related...
Code: Select all
for (page : srcDoc.Pages)
{
newPage = newDoc.Pages.InserPage(-1, page.Box[PBox_MediaBox] .. );
// copy content
con = srcPage.GetContent(CAccessMode_Readonly);
newPage.PlaceContent(CAccessMode_FullClone, con);
// then copy comments using srcPage.GetAnnotsCount/GetAnnot...
}
- also biggest problem is - it seems impossible to copy existing AcroForm in such way. Because it is too complex stuff in common case.
Cheers.
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Print a PDF to PDF via SDK SOLVED
Hi Vasyl,
Thank for the input.
-žarko
Thank for the input.
-žarko
- Tracker Supp-Stefan
- Site Admin
- Posts: 17948
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact: