Forum for the PDF-XChange Editor - Free and Licensed Versions
Moderators:PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
Just for clarification:
this concerns JS contained in a PDF, not the SDK.
I have been using the Field method buttonImportIcon for a long time to have PDFXEdit prompt the user for an icon for a field. Note the empty string for cPath.
The following code snipped worked in version 8 and 9:
Sorry for the delay, I have escalated this to our Dev team for review and resolution.
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com [email protected]
Just a quick followup, you noted this started after V10, can you confirm which specific build you are running at the moment? The latest release is 10.8.4, so if you are not updated, please do so now.
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com [email protected]
Let me dscribe, how I resolved the issue. Maybe that will give you additional information as to why buttonImportIcon() wouldn't accept an empty path anymore.
I delegated the functionality 'prompt user for a file path' from the code inside stamps.pdf to folder level javascript in %appdata%/.../Javascript/stamps.js
Like so:
Terribly sorry for the delay, somehow I missed this until just now, for which I apologize. I have just sent this new information up the chain for further review (and they informed me that I misread your reply anyway, it seems that you found the correct solution here)
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com [email protected]
It looks to be a case opf B, this is what i got from the Dev team:
In V10, we are following the JS spec, respecting security.
He found the proper solution - use of app.trustedFunction
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com [email protected]
It looks to be a case opf B, this is what i got from the Dev team:
In V10, we are following the JS spec, respecting security.
He found the proper solution - use of app.trustedFunction
Kind regards,
Hi Daniel,
Do the dev team understand that this is crashing PXCE? Shouldn't it just throw an error? The attached stamp file crashes build 410 with the following javascript:
{
const f = this.getField("Button2");
let res;
try{
// this crashes after the stamp is placed - it appears to set the icon OK, but then crashes
res = f.buttonImportIcon();
} catch(e) {
console.println(e)
}
console.println("Result: "+res);
}
I'm not good at making these animated gifs, but this tries to show:
buttonImportCrash.gif
Mathew.
test_crashes_buttonImportIcon.pdf
You do not have the required permissions to view the files attached to this post.
Yes, the note about crashing was conveyed, however we could not reproduce any such crash on this end. Are you also updated to 10.8.5? If you are and there is still a crash, I would need to ask for a crashdump to provide the dev team.
As usual, these should appear here automatically:
%localappdata%\CrashDumps
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com [email protected]