Hello,
I want to import annotations from an FDF file using javascript and the function importAnFDF. According to the API reference this function has a parameter cPath where you can specify the path. However when using this function like importAnFDF("<path>") the file dialog still appears, and the cPath parameter is ignored.
When using the function exportAsFDF this problem does not occur, and the FDF file is created at the location provided by the cPath parameter. without a file dialog appearing.
How can I import an FDF through javascript without the file dialog appearing?
I'm using version 9.4 build 364.0
Kind regards,
David
Javascript function importAnFDF always shows the file dialog
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
- TrackerSupp-Daniel
- Site Admin
- Posts: 8440
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Javascript function importAnFDF always shows the file dialog
Hello, dboef
Are you using the fullpath in the <path> section of your JS, or are you simply entering the filename? If you are only entering the filename, as in the JS API reference manual's example, you will need to ensure that the fdf file in question is located in the same folder as the PDF you are running this import in. Otherwise, it would be best to use the complete path, including "C:\...\etc" leading up to the file.
If that is still not working, please send me a copy of the string you are using, so that we can take a look and see if there is a typo or something that is causing the issue.
Kind regards,
Are you using the fullpath in the <path> section of your JS, or are you simply entering the filename? If you are only entering the filename, as in the JS API reference manual's example, you will need to ensure that the fdf file in question is located in the same folder as the PDF you are running this import in. Otherwise, it would be best to use the complete path, including "C:\...\etc" leading up to the file.
If that is still not working, please send me a copy of the string you are using, so that we can take a look and see if there is a typo or something that is causing the issue.
Kind regards,
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: Javascript function importAnFDF always shows the file dialog
Hello Daniel,
I am using the full path as the parameter
For exporting I use:
This creates the test.fdf file in the directory C:\PDF as expected.
I then clear the annotations in the file and try importing them.
For importing I use:
This shows the file dialog instead of directly importing the annotations. (If I use the file dialog the annotations are imported correctly)
I've attached the annoted pdf I'm using for testing :
Kind regards,
David
I am using the full path as the parameter
For exporting I use:
Code: Select all
exportAsFDF(true, true, null, true, "C:\\PDF\\test.fdf", true);
I then clear the annotations in the file and try importing them.
For importing I use:
Code: Select all
importAnFDF("C:\\PDF\\test.fdf");
I've attached the annoted pdf I'm using for testing :
Kind regards,
David
Re: Javascript function importAnFDF always shows the file dialog
Hello dboef,
Sorry for interrupting. When specifying a file path in PDF JavaScript, formally it must be a device-independent path. Try the following.
rakunavi
Sorry for interrupting. When specifying a file path in PDF JavaScript, formally it must be a device-independent path. Try the following.
Code: Select all
importAnFDF("/C/PDF/test.fdf");
- File paths in Acrobat JavaScript
https://acrobatusers.com/tutorials/file-paths-acrobat-javascript/
rakunavi
TOP desires for PDFXCE
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
Re: Javascript function importAnFDF always shows the file dialog
Hello rakanuvi.
Thank you. It works now.
Kind regards,
David
Thank you. It works now.
Kind regards,
David
- Tracker Supp-Stefan
- Site Admin
- Posts: 17824
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact: