Can I Optimized PDF file with JAVASCRIPT ?
Can you show me a demo?
Optimized PDF with JS
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
- TrackerSupp-Daniel
- Site Admin
- Posts: 8436
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Optimized PDF with JS
Hello xcq,
I do not believe it is possible, but I have asked the Dev team for feedback to make sure for you.
I am curious however, about why you would like to use JavaScript for this action, when we already have a highly configurable "Save as Optimized" function available in both our Editor and PDF-Tools?
Looking forward to your reply.
I do not believe it is possible, but I have asked the Dev team for feedback to make sure for you.
I am curious however, about why you would like to use JavaScript for this action, when we already have a highly configurable "Save as Optimized" function available in both our Editor and PDF-Tools?
Looking forward to your reply.
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
- TrackerSupp-Daniel
- Site Admin
- Posts: 8436
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Optimized PDF with JS
Hello again xcq,
I have just heard back from the Devs, and it appears it is possible to setup JS to call our optimize function, but when using this method you cannot control and of the settings. As I suspected however, it is not possible to do the actual optimization with JS alone.
Here is the Devs reply and Example:
I have just heard back from the Devs, and it appears it is possible to setup JS to call our optimize function, but when using this method you cannot control and of the settings. As I suspected however, it is not possible to do the actual optimization with JS alone.
Here is the Devs reply and Example:
I hope this helps!To do that, saveAs method of document should be used with cConv parameter equal to conv.optimized.pdf
Example,Code: Select all
this.saveAs({cPath:"/e/temp/test2.pdf", cConv:"conv.optimized.pdf"});
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Re: Optimized PDF with JS
Thanks.I have try the code but it seems useless.The size of output file equal to the input file.TrackerSupp-Daniel wrote: ↑Tue Jan 22, 2019 9:12 pm Hello again xcq,
I have just heard back from the Devs, and it appears it is possible to setup JS to call our optimize function, but when using this method you cannot control and of the settings. As I suspected however, it is not possible to do the actual optimization with JS alone.
Here is the Devs reply and Example:I hope this helps!To do that, saveAs method of document should be used with cConv parameter equal to conv.optimized.pdf
Example,Code: Select all
this.saveAs({cPath:"/e/temp/test2.pdf", cConv:"conv.optimized.pdf"});
Because I have a lot of files to optimize so I want to do optimization with code.
How can I do with scripts(c# or JS)?
- TrackerSupp-Daniel
- Site Admin
- Posts: 8436
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Optimized PDF with JS
Hello xcq,
As I mentioned before, it is not possible to manage the settings when calling via JS, but the Editor and PDF-Tools suite both offer functions to optimize by default.
In PDF-Tools, Simply configure the settings and then run the tool, selecting all the files you wish to optimize at once (exactly what you are looking for): Or in the Editor, open the desired document, and click File > save as optimized, one file at a time (not really what you are looking for): If you absolutely have to do this via code, (thought I'm still unsure why you would want to when it already exists in a 3 click solution), you can take a look at our Editor SDK, which would offer the optimize function. Examples are available from our EditorSDK GitHub repository.
As I mentioned before, it is not possible to manage the settings when calling via JS, but the Editor and PDF-Tools suite both offer functions to optimize by default.
In PDF-Tools, Simply configure the settings and then run the tool, selecting all the files you wish to optimize at once (exactly what you are looking for): Or in the Editor, open the desired document, and click File > save as optimized, one file at a time (not really what you are looking for): If you absolutely have to do this via code, (thought I'm still unsure why you would want to when it already exists in a 3 click solution), you can take a look at our Editor SDK, which would offer the optimize function. Examples are available from our EditorSDK GitHub repository.
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com