Optimization
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
Optimization
I am creating a PDF by insertpagesto and then want to run optimization, but optimization doesn't accomplish anything. If I take the same PDF file and run the PDF-Tools program itself (your program) to the same document it cuts the file size by more than half. Is there a way thru code to perform the same optimization as the PDF-Tools program.
Here is effectively what I am doing, which I think matches what I do in the command line tool.
Dim pdf As Integer
res = PDFToolsLib.PXCp_Init(pdf, PDFToolsLib.g_RegKey, PDFToolsLib.g_DevCode)
res = PDFToolsLib.PXCp_ReadDocumentW(pdf, Filename, 0)
res = PDFToolsLib.PXCp_SetSpecVersion(pdf, PDFToolsLib.PXC_SpecVersion.SpecVersion16)
res = PDFToolsLib.PXCp_OptimizeFonts(pdf, 0)
res = PDFToolsLib.PXCp_OptimizeRemoveNamedDests(pdf)
res = PDFToolsLib.PXCp_OptimizeStreamCompression(pdf)
res = PDFToolsLib.PXCp_WriteDocumentW(pdf, Filename, PDFToolsLib.PXCp_CreationDisposition.PXCp_CreationDisposition_Overwrite, _
CType(PDFToolsLib.PXCp_WriteDocFlag.PXCp_Write_Release, Integer))
Thanks for the help.
Here is effectively what I am doing, which I think matches what I do in the command line tool.
Dim pdf As Integer
res = PDFToolsLib.PXCp_Init(pdf, PDFToolsLib.g_RegKey, PDFToolsLib.g_DevCode)
res = PDFToolsLib.PXCp_ReadDocumentW(pdf, Filename, 0)
res = PDFToolsLib.PXCp_SetSpecVersion(pdf, PDFToolsLib.PXC_SpecVersion.SpecVersion16)
res = PDFToolsLib.PXCp_OptimizeFonts(pdf, 0)
res = PDFToolsLib.PXCp_OptimizeRemoveNamedDests(pdf)
res = PDFToolsLib.PXCp_OptimizeStreamCompression(pdf)
res = PDFToolsLib.PXCp_WriteDocumentW(pdf, Filename, PDFToolsLib.PXCp_CreationDisposition.PXCp_CreationDisposition_Overwrite, _
CType(PDFToolsLib.PXCp_WriteDocFlag.PXCp_Write_Release, Integer))
Thanks for the help.
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Re: Optimization
Hi any chance you could upload a before and after file so we can compare the content and advise - please also include the PDF-Tools end user app (generated PDF) file and your full code so that we have the 'good the bad and the ugly'
please zip any files posted.
thanks
please zip any files posted.
thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
Re: Optimization
From where can i get the object PDFToolsLib? I have downloaded PDF xchange editor, viewer, tools sdk, but i am not getting the reference from any of the components. Please help me, it is very urgent. We have a production deployment coming soon. We have licensed version of PDFXchange.
- Tracker Supp-Stefan
- Site Admin
- Posts: 17929
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Optimization
Hello bijuig,
Is it the PDF Tools SDK that you are after? You can find it here:
https://www.pdf-xchange.com/product/pdf-tools-sdk
But please note that it has been replaced by the Core API, and as such the above link is now found on the "Discontinued Products" download page.
Regards,
Stefan
Is it the PDF Tools SDK that you are after? You can find it here:
https://www.pdf-xchange.com/product/pdf-tools-sdk
But please note that it has been replaced by the Core API, and as such the above link is now found on the "Discontinued Products" download page.
Regards,
Stefan
Re: Optimization
This is the same SDK and Core API I have downloaded and installed. But it does not have PDFToolsLib. Can you please help me? Or some other class has this PXCp_Init?
- Tracker Supp-Stefan
- Site Admin
- Posts: 17929
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Optimization
Hello bijuig,
The PXCp_Init method is definitely part of the Tools SDK:
https://help.pdf-xchange.com/DEV/de ... :pxcp_init
Please do check the sample projects provided with the Tools SDK and you should see how to use that method. I just checked my link - it is the correct one pointing to the Tools SDK page.
Regards,
Stefan
The PXCp_Init method is definitely part of the Tools SDK:
https://help.pdf-xchange.com/DEV/de ... :pxcp_init
Please do check the sample projects provided with the Tools SDK and you should see how to use that method. I just checked my link - it is the correct one pointing to the Tools SDK page.
Regards,
Stefan
Re: Optimization
Thanks Stefan. Your suggestion and referring to the sample code, I made our code work. But now the problem is, it is showing we have used evaluation version. But we have a valid license for PDF printer. Does that not apply for PDF SDK or Core API? If it applies, please let me know what should i do to remove the watermark.
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Re: Optimization
Hi,
You must have a PDF-XChange Drivers API SDK or a PDF-XChange PRO SDK license to use our printer drivers - if that is what you are referring to ?
If not please explain further ...
You must have a PDF-XChange Drivers API SDK or a PDF-XChange PRO SDK license to use our printer drivers - if that is what you are referring to ?
If not please explain further ...
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
Re: Optimization
Yes, we have PDF XChange Drivers API SDK license. Can we use the same license for handling Core API SDK or PDF Tools SDK? Please confirm.
- Tracker Supp-Stefan
- Site Admin
- Posts: 17929
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Optimization
Hello bijuig,
Please send us an e-mail with your order number or part of the serial number to support@pdf-xchange.com and we will be able to advise if the key is good for the Tools SDK as well. If not - you might need to upgrade your Drivers API license to a Pro SDK one - to get access to the Tools and Core APIs. We will be able to advise once we see the license.
There are public forums so please do not post any license info here!
Regards,
Stefan
Please send us an e-mail with your order number or part of the serial number to support@pdf-xchange.com and we will be able to advise if the key is good for the Tools SDK as well. If not - you might need to upgrade your Drivers API license to a Pro SDK one - to get access to the Tools and Core APIs. We will be able to advise once we see the license.
There are public forums so please do not post any license info here!
Regards,
Stefan
Re: Optimization
I have send you the mail with the license information. Please respond at the earliest.
- Tracker Supp-Stefan
- Site Admin
- Posts: 17929
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Optimization
Thanks bijuig,
Replied to your e-mail. We can continue the license discussion there, as I believe e-mails are more suited for that license discussion.
Regards,
Stefan
Replied to your e-mail. We can continue the license discussion there, as I believe e-mails are more suited for that license discussion.
Regards,
Stefan