InsertPagesFromDoc with PDF/A

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

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.
Post Reply
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

InsertPagesFromDoc with PDF/A

Post by jeffp »

I'm trying to append a one page PDF document into an existing PDF/A document using

IPXC_Pages.InsertPagesFromDoc

It works fine when the existing document is a normal PDF document, but when it is a PDF/A document don't insert and I get the following return value

-2112221168

I'm using the following as my flags

AFlags := IPF_Annots_Copy + IPF_Bookmarks_CopyAll

But also tried with AFlags := 0; but it doesn't work either.

Is there something I must do first to the PDF/A document in order to be able to insert other PDF pages into it?

Thanks.

--Jeff
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: InsertPagesFromDoc with PDF/A

Post by jeffp »

In looking into this further, it looks like for the PDFA document the insert permission (and others) is set to False.

(pDoc.RequestPermission(Perm_ObjDoc, Perm_OperInsert, 0) <> Perm_ReqGranted)

The file doesn't have any passwords, so it look like I just need to set Perm_OperInsert (and others) to true.

How do I do this? Was looking for some kind of SetPermission call like PXCp_SetPermissions which you had in your older DLLs.

Or do I need to set some additional flags when I call IPXC_Inst.OpenDocumentFromFile(PChar(AFileName), ACallBack, nil, 0, 0);?

--Jeff
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: InsertPagesFromDoc with PDF/A

Post by Ivan - Tracker Software »

For PDF/A documents the Editor blocks editing features as they may eliminate the document's PDF/A compliance.

You can remove PDF/A compliance from the IPXV_Document calling its method DiscardPDFACompilance.

HTH
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: InsertPagesFromDoc with PDF/A

Post by jeffp »

Thanks Ivan.

But I'd like to use just the core document if possible. Is there a way to discard the PDFA compliance using the IPXC_Document object?

Also, once I discard the compliance and insert additional pages, will it still be a PDFA when I save it back out? Or will I need to run my convert to PDFA procedure?

Lastly, is the a way to know if the document is PDFA compliant upon opening the document? And what PDFA it is such as PDF/A-1 or PDF/A-2, etc.

--Jeff
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: InsertPagesFromDoc with PDF/A

Post by Sasha - Tracker Dev Team »

Hello Jeff,

Just spoke with Ivan, here's what he said:
But I'd like to use just the core document if possible. Is there a way to discard the PDFA compliance using the IPXC_Document object
It's probably possible though I'm not sure that the correct mechanisms are available for the SDK. I will look at it and will try to update this for the 320 build if they are missing.
Also, once I discard the compliance and insert additional pages, will it still be a PDFA when I save it back out?
Discard is discard - it won't be the PDF\A anymore.
Or will I need to run my convert to PDFA procedure?
Then you will need to use the Save To PDFA operation that is available only on the Editor SDK level.
Lastly, is the a way to know if the document is PDFA compliant upon opening the document?
Yes, there is a way:
https://sdkhelp.pdf-xchange.com/vie ... DFStandard


Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: InsertPagesFromDoc with PDF/A

Post by jeffp »

Perfect. Thanks.
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: InsertPagesFromDoc with PDF/A

Post by Will - Tracker Supp »

:D
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
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: InsertPagesFromDoc with PDF/A

Post by jeffp »

Thinking about this further, adding a DiscardPDFACompilance or equivalence call on just the core document IPXC_Document would be useful for those like me who try to stick to the core document if possible. It would remove the added step of converting the IPXC_Document into a IPXV_Document just to make that call.

--Jeff
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: InsertPagesFromDoc with PDF/A

Post by Sasha - Tracker Dev Team »

Hello Jeff,

As Ivan said before - he will try to add this in the nearest future build.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply