Export/Import annotation as "xfdf"

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

sukhman
User
Posts: 23
Joined: Fri Jul 03, 2009 6:19 am

Export/Import annotation as "xfdf"

Post by sukhman »

Hi,

I want to export/import annotations from the document as "fdf/xfdf". Referring to the SDK manual, I could n't find anything useful.
Even I tried the following:
document.all.PXCV.RunJavaScript("this.exportAsXFDF(true,true,null, true")
but this is not working (throws unknown exception) as this in turn is referring to Javascript for Adobe Acrobat API. Can anybody tell how to use the "RunJavascript" from PDFxchange viewer or any other way by which I can export/import annotations from the document as "fdf/xfdf" programmatically.
sukhman
User
Posts: 23
Joined: Fri Jul 03, 2009 6:19 am

Re: Export/Import annotation as "xfdf"

Post by sukhman »

Hi,

The abovementioned error "unknown exception" is resolved. Not the command
document.all.PXCV.RunJavaScript("this.exportAsXFDF(true,true,null,'/annots.xfdf',true)")
runs without any error , but doesn't produce any output xfdf file.

Please guide.

Thanks and Regards,
Sukhmanpreet Kaur
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Export/Import annotation as "xfdf"

Post by Corwin - Tracker Sup »

Hello sukhman,
You can export annotations by using this code:

Code: Select all

document.all.PDFView.RunJavaScript('this.exportAsFDF(true, true, null, true);');
document.all.PDFView.RunJavaScript('this.exportAsFDF({bAllFields:true, bNoPassword:true, bAnnotations:true});');
document.all.PDFView.RunJavaScript('this.exportAsFDF(true, true, null, true, "/c/annots.fdf", true);');
document.all.PDFView.RunJavaScript('this.exportAsXFDF({bAllFields:true, bNoPassword:true, bAnnotations:true});');
document.all.PDFView.RunJavaScript('this.exportAsXFDF(true, true, null, "/c/annots.xfdf", true);');
And for import:

Code: Select all

document.all.PDFView.RunJavaScript('this.importAnFDF("/c/annots.fdf");');
document.all.PDFView.RunJavaScript('this.importAnXFDF("/c/annots.xfdf");');
Also for ASP.NET you can download sample project from this post:
https://forum.pdf-xchange.com/ ... 995#p28995
Last edited by Corwin - Tracker Sup on Wed Jul 22, 2009 2:14 pm, edited 3 times in total.
sukhman
User
Posts: 23
Joined: Fri Jul 03, 2009 6:19 am

Re: Export/Import annotation as "xfdf"

Post by sukhman »

Hi Corwin,

But where will this exported file be saved, coz I tried to run the mentioned script. Althought it runs successfully, but cannot see the exported xfdf anywhere.

Thanks and Regards,
Sukhman
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Export/Import annotation as "xfdf"

Post by Corwin - Tracker Sup »

Code: Select all

this.exportAsXFDF(true, true, null, "/c/annots.xfdf", true);
This will export to c:\annots.xfdf

Code: Select all

this.exportAsXFDF(true, true, null, "annots.xfdf", true);
This will export to the document's folder

HTH
sukhman
User
Posts: 23
Joined: Fri Jul 03, 2009 6:19 am

Re: Export/Import annotation as "xfdf"

Post by sukhman »

Hi Corwin,

Thanks for the reply.

I could export to the specific path with the filename as "annots.xdf" .My requirement is to create the filename at runtime and then pass it to the Export command as follows:

var exprtPath = "e/Test/Test1.xfdf";
document.all.PXCV.RunJavaScript('this.exportAsXFDF(true, true, null,exprtPath, true);');

But this is giving me unknown exception. Please guide.

Thanks and Regards,
Sukhman
sukhman
User
Posts: 23
Joined: Fri Jul 03, 2009 6:19 am

Re: Export/Import annotation as "xfdf"

Post by sukhman »

Hi Corwin,

I could resolve this problem.

Thanks and Regards,
Sukhman
arjunaugust
User
Posts: 7
Joined: Fri Jul 10, 2009 3:54 am

Re: Export/Import annotation as "xfdf"

Post by arjunaugust »

Hi,

I have problem when i import comments file from server.

this is the path of this file:
http://serverName:port/annots.xfdf

the code is:
document.all.PXCV.RunJavaScript('this.importAnXFDF("http://serverName:port/annots.xfdf");');
sukhman
User
Posts: 23
Joined: Fri Jul 03, 2009 6:19 am

Re: Export/Import annotation as "xfdf"

Post by sukhman »

Hi Corwin,

Can we import an "xfdf" file from server URL.

We tried : document.all.PXCV.RunJavaScript('this.importAnXFDF("http://ps5769:3049/Paxonix%20Docs/annots.xfdf");');

But its not giving any output. Please suggest.

Regards,
Sukhman
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Export/Import annotation as "xfdf"

Post by Corwin - Tracker Sup »

Hi all,
No, you cannot import FDF or XFDF from server URL.
sukhman
User
Posts: 23
Joined: Fri Jul 03, 2009 6:19 am

Re: Export/Import annotation as "xfdf"

Post by sukhman »

Hi Corwin.

Thanks for the reply.

Regards,
Sukhman
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Export/Import annotation as "xfdf"

Post by John - Tracker Supp »

pleasure :)
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