Importing comments and fields - failed  SOLVED

PDF-XChange Editor SDK for Developers

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
chr20
User
Posts: 12
Joined: Tue Feb 21, 2017 7:31 am

Importing comments and fields - failed

Post by chr20 »

Hi,

I'd like to import annots using 'op.document.importCommentsAndFields'

But I got a error message :
An unhandled exception of type 'System.AccessViolationException' occurred in EDASMerger.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

The code is..

Code: Select all

PDFXEdit.IPXC_DocAuthCallback authCallBack = null;
PDFXEdit.IPXC_Document docTest = _pxcInst.OpenDocumentFromFile(@"C:\b.pdf", authCallBack);

int nIDImport = _pdfInst.Str2ID("op.document.importCommentsAndFields", false);
PDFXEdit.IOperation opImport = _pdfInst.CreateOp(nIDImport);
PDFXEdit.ICabNode inputImport = opImport.Params.Root["Input"];
inputImport.v = docTest;
PDFXEdit.ICabNode optionsImport = opImport.Params.Root["Options"];
optionsImport["FileName"].v = @"C:\test.FDF";
opImport.Do();

There is no error on the .FDF file.
I think this is a bug.
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Importing comments and fields - failed

Post by Sasha - PDF-XChange »

Hello chr20,

Please use the try-catch block to handle the exception and use the https://sdkhelp.pdf-xchange.com/vie ... matHRESULT method to get the information about it. Once you done that, paste that information here so that we can assist further.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
chr20
User
Posts: 12
Joined: Tue Feb 21, 2017 7:31 am

Re: Importing comments and fields - failed

Post by chr20 »

Hello Alex,

Thank you for your reply.
I tried try-catch block, but stepping in 'opImport.Do();' line, just stopped debugging and popped up error message above.
There are no chance to go to catch block.

Using input as PDFXEdit.IPXC_Document in AxPDFXEdit.AxPXV_Control is fine.
But I manually opened document using

Code: Select all

            PDFXEdit.PXV_Inst _pdfInst;
            PDFXEdit.IPXC_Inst _pxcInst;

            string licKey = @"MY KEY";

            _pdfInst = new PDFXEdit.PXV_Inst();
            _pdfInst.Init(null, licKey);
            
            _pxcInst = (PDFXEdit.IPXC_Inst)_pdfInst.GetExtension("PXC");

            PDFXEdit.IPXC_DocAuthCallback authCallBack = null;
            PDFXEdit.IPXC_Document docTest = _pxcInst.OpenDocumentFromFile(@"C:\b.pdf", authCallBack);
is not working.

If I opened document wrong way, please let me know about right method.

Thank you in advance.
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Importing comments and fields - failed

Post by Sasha - PDF-XChange »

Hello chr20,

From what you are telling you have not implemented the try-catch block correctly. If you want, you can make a small sample project where we can recreate this behavior. Also, please include the file that you were testing on.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
chr20
User
Posts: 12
Joined: Tue Feb 21, 2017 7:31 am

Re: Importing comments and fields - failed

Post by chr20 »

Okay,

Here is a sample project.

http://bigfile.mail.naver.com/bigfileup ... +SazEqFm==

I would appreciate it if you check what the problem is.
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Importing comments and fields - failed

Post by Sasha - PDF-XChange »

Hello chr20,

There was a bug in the ImportCommentsAndFields operation when the document was not opened in the Control. We fixed this bug, though the official fix would be available from the next build. Meanwhile you can try opening the document for the import operation in the IPXV_Control, and try your code - it should work.

Also, in your sample, you forgot to call Shutdown of the Instance. Please be sure to do that.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
chr20
User
Posts: 12
Joined: Tue Feb 21, 2017 7:31 am

Re: Importing comments and fields - failed

Post by chr20 »

Okay, Thank you for your help.

Actually, this implementation is a DLL that merges comments from different reviewers of the same documents without using control as part of my project.
So I can't use a control to open the document. Could you provide a temporary build for me?
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Importing comments and fields - failed

Post by Sasha - PDF-XChange »

Hello chr20,

OK, once I deploy it I will notify you about it.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
chr20
User
Posts: 12
Joined: Tue Feb 21, 2017 7:31 am

Re: Importing comments and fields - failed

Post by chr20 »

Thank you, Alex!!
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm

Re: Importing comments and fields - failed

Post by Will - Tracker Supp »

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

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Importing comments and fields - failed  SOLVED

Post by Sasha - PDF-XChange »

Hello chr20,

The dev. build is out - you can download it from here:
https://forum.pdf-xchange.com/ ... 66&t=25943

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
chr20
User
Posts: 12
Joined: Tue Feb 21, 2017 7:31 am

Re: Importing comments and fields - failed

Post by chr20 »

Thank you very much!! :D
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Importing comments and fields - failed

Post by Sasha - PDF-XChange »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ