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, Chris - Tracker Supp, Sean - Tracker, 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: 127
Joined: Fri Jun 25, 2010 6:54 am

Core Api PDF/A3 lost

Post by edvschu »

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
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Core Api PDF/A3 lost

Post by Ivan - Tracker Software »

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: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api PDF/A3 lost

Post by edvschu »

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 307 times
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Core Api PDF/A3 lost

Post by Sasha - Tracker Dev Team »

Hi, edvschu.

We're looking into this problem and will answer you when we'll have an answer.
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Core Api PDF/A3 lost

Post by Ivan - Tracker Software »

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: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api PDF/A3 lost

Post by edvschu »

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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Core Api PDF/A3 lost

Post by Sasha - Tracker Dev Team »

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'.
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
edvschu
User
Posts: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api PDF/A3 lost

Post by edvschu »

Now it is clear :D .
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Core Api PDF/A3 lost

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Core Api PDF/A3 lost

Post by John - Tracker Supp »

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: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: Core Api PDF/A3 lost

Post by edvschu »

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: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Core Api PDF/A3 lost

Post by Tracker Supp-Stefan »

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