Core Api PDF/A3 lost

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, 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
edvschu
User
Posts: 122
Joined: Fri Jun 25, 2010 6:54 am

Core Api PDF/A3 lost

Post by edvschu » Mon Oct 05, 2015 2:59 pm

Hello,

i write XMP Data into a PDF/A3. After that, it's no longer a PDF/A3.

I tried the following:
(1) Open the PDF/A3, do nothing and write in new file, PDF/A3 lost.
(2) Open the PDF/A3, do nothing and write in same file, PDF/A3 not lost.

Code: Select all

pDoc = pInst.OpenDocumentFromFile(sFilePath, Nothing, Nothing, 0, 0)
pDoc.WriteToFile(PdfFileOut, Nothing, 0)
What am I doing wrong?

Best Regards,
edvschu

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

Re: Core Api PDF/A3 lost

Post by Ivan - Tracker Software » Mon Oct 05, 2015 10:18 pm

Are you using latest build (315) of the Core API ? I just checked and cannot reproduce the issue.
Can you send me your file as it might be file specific issue?
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.

edvschu
User
Posts: 122
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api PDF/A3 lost

Post by edvschu » Tue Oct 06, 2015 9:59 am

I use last Build (315) of Core Api.

Problem with writing in same/new file are resolved. But writing XMP Data resulting in the loss of PDF/A3 Format.

I do this:

Code: Select all

Dim pDoc As LIBNAME.IPXC_Document = OpenDocumentFromFile(sFile, pdfInst)
If pDoc Is Nothing Then
   Return
End If

Dim Meta As LIBNAME.IPXC_XMPMetadata = pDoc.GetXMPMetadata
Dim sSchemaZUGFeRD As String = System.IO.File.ReadAllText(sFileDir & "ZUGFeRD_extension_schema.xmp")
Dim sptr As IntPtr = Marshal.StringToHGlobalAnsi(sSchemaZUGFeRD)
Dim iDataSize As UInteger = Convert.ToUInt32(sSchemaZUGFeRD.Length)
Dim memBlock As LIBNAME.IMemBlock = auxInst.CreateMemBlock()

memBlock.SetData(sptr, iDataSize)
Meta.SetXMP(memBlock)

pDoc.WriteToFile(sFileXMP)
pDoc.Close()
Can anyone help?

Regards,
edvschu
Attachments
SampleFiles.zip
(18.16 KiB) Downloaded 117 times

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

Re: Core Api PDF/A3 lost

Post by Sasha - Tracker Dev Team » Tue Oct 06, 2015 12:26 pm

Hi, edvschu.

We're looking into this problem and will answer you when we'll have an answer.
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

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

Re: Core Api PDF/A3 lost

Post by Ivan - Tracker Software » Tue Oct 06, 2015 6:40 pm

As I see your code replaces XMP metadata, not append it.
And your XMP block has no:

Code: Select all

		<rdf:Description rdf:about=""
				xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/">
			<pdfaid:part>3</pdfaid:part>
			<pdfaid:conformance>B</pdfaid:conformance>
		</rdf:Description>
block.

Also there some issues with editing PDF/A documents - some methods prevents PDF/A documents modification.
Will fix this issue, and will add a method to add blocks to existing XMP metadata.
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.

edvschu
User
Posts: 122
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api PDF/A3 lost

Post by edvschu » Wed Oct 07, 2015 7:31 am

Thanks for information.

Which method i must use for appending?

From Adobe there are an XMP SDK. I append these XMP Data on these PDF. The XMP Block was no required.
Must it be done differently with Core Api?

What do you mean with 'fix this issue'?

Regards,
edvschu

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

Re: Core Api PDF/A3 lost

Post by Sasha - Tracker Dev Team » Wed Oct 07, 2015 8:59 am

Hello, edvschu.

As Ivan said, we will add a method to append blocks to existing XMP metadata in the future build.
As for the 'issue fix' - it's about 'some methods prevent PDF/A documents modification'.
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

edvschu
User
Posts: 122
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api PDF/A3 lost

Post by edvschu » Wed Oct 07, 2015 9:24 am

Now it is clear :D .

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

Re: Core Api PDF/A3 lost

Post by Sasha - Tracker Dev Team » Wed Oct 07, 2015 9:31 am

:)
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Re: Core Api PDF/A3 lost

Post by John - Tracker Supp » Thu Oct 15, 2015 2:54 pm

Please post your Core API Questions in the correct forum to avoid confusion and delays

Thanks - we will move as appropriate.

thanks
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

edvschu
User
Posts: 122
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api PDF/A3 lost

Post by edvschu » Thu Oct 13, 2016 9:37 am

Hello,
Sasha - Tracker Dev Team wrote:As Ivan said, we will add a method to append blocks to existing XMP metadata in the future build.
will this method yet to come?

Best regards,
edvschu

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13544
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Core Api PDF/A3 lost

Post by Tracker Supp-Stefan » Thu Oct 13, 2016 9:55 am

Hello edvschu,

I have asked Ivan to post an update here in this topic, but because of where he is (Western Canada) - the reply will come a bit later. Still - we will share with you any news as soon as we can!

Regards,
Stefan

Post Reply