Combine PDF and XML to an E-Invoice PDF (ZUGFeRD)  SOLVED

PDF-XChange Editor SDK for Developers

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

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
Fanski
User
Posts: 33
Joined: Tue Apr 17, 2012 10:33 am

Combine PDF and XML to an E-Invoice PDF (ZUGFeRD)

Post by Fanski » Fri Dec 20, 2019 1:16 pm

What I need is to add an existing xml file to an existing PDF/A-3 and add the XMP Metadata:

urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0#
zf:ConformanceLevel: BASIC
zf:DocumentFileName: ZUGFeRD-invoice.xml
zf:DocumentType: INVOICE
zf:Version: 1.0

The result should be an e-invoice PDF like that in the attachment
ZUGFeRD_1p0_BASIC_Einfach.pdf
(85.83 KiB) Downloaded 21 times
.
If its possible, could you help me with some examples?

kind regards
Peter

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

Re: Combine PDF and XML to an E-Invoice PDF (ZUGFeRD)

Post by Sasha - Tracker Dev Team » Wed Dec 25, 2019 10:46 am

Hello Peter,

Forwarded this to the developer who can tell more.

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

Fanski
User
Posts: 33
Joined: Tue Apr 17, 2012 10:33 am

Re: Combine PDF and XML to an E-Invoice PDF (ZUGFeRD)

Post by Fanski » Mon Jan 06, 2020 9:01 am

Hi Alex,

news on this topic?

kind regards
Peter

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

Re: Combine PDF and XML to an E-Invoice PDF (ZUGFeRD)

Post by Tracker Supp-Stefan » Mon Jan 06, 2020 2:33 pm

Hello Peter,

We are still awaiting the feedback from the correct developer, and as soon as we have it - we will post it here!

Regards,
Stefan

Fanski
User
Posts: 33
Joined: Tue Apr 17, 2012 10:33 am

Re: Combine PDF and XML to an E-Invoice PDF (ZUGFeRD)

Post by Fanski » Tue Jan 07, 2020 10:06 am

Hi Stefan,

The first step i need, is to add an attachment (file) to the PDF programmatically (very easy to do with the PDF XChange Editor GUI). Maybe you could help me with this without the developer? Sorry about asking again, but I need a solution in the next days for the attachment problem. For adding the XMP Metadata I have a workaround if that’s the problem.

Kind regards

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

Re: Combine PDF and XML to an E-Invoice PDF (ZUGFeRD)

Post by Sasha - Tracker Dev Team » Wed Jan 08, 2020 9:49 am

Hello Peter,

Got a response about the XML\XMP. The Editor itself cannot import the data from the XML, but, if you can parse the XML yourself, then you can easily get the needed data and paste in into the needed fields manually. This interface should prove useful:
https://sdkhelp.tracker-software.com/vi ... MPMetadata

As for the attachment adding - there is a sample on that one here:
https://sdkhelp.tracker-software.com/vi ... hments_add

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

Fanski
User
Posts: 33
Joined: Tue Apr 17, 2012 10:33 am

Re: Combine PDF and XML to an E-Invoice PDF (ZUGFeRD)

Post by Fanski » Wed Jan 08, 2020 4:52 pm

Hi Alex,
thank you. Adding the attachment to PDF works fine :)
For the XMP metadata I use a workaround at the moment, will try your way later.
I have one question left.
To get an PDFXEdit.IPXV_Document I initialize a AxPXV_Control on a Form (I need to show the form) and open the pdf (axPxvControl.OpenDocFromPath). Is it possible to open a pdf document for adding a attachment without showing the AxPXV_Control?

Kind regards
Peter

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

Re: Combine PDF and XML to an E-Invoice PDF (ZUGFeRD)  SOLVED

Post by Sasha - Tracker Dev Team » Thu Jan 09, 2020 7:06 am

Hello Peter,

Of course, you can just use the IPXC (Core) level to open the IPXC_Document, add attachment to it and save it for example (or open it in the IPXV_Control if needed by passing the interface into the Open method on the IPXV level).
Check out the CoreAPI demo for the Core level training - it holds many samples:
https://github.com/tracker-software/PDFCoreSDKExamples

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

Fanski
User
Posts: 33
Joined: Tue Apr 17, 2012 10:33 am

Re: Combine PDF and XML to an E-Invoice PDF (ZUGFeRD)

Post by Fanski » Mon Jan 13, 2020 11:00 am

Hi Alex,
Thank you for your Help.
I managed it with your help.

Kind regards
Peter

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

Re: Combine PDF and XML to an E-Invoice PDF (ZUGFeRD)

Post by Sasha - Tracker Dev Team » Mon Jan 13, 2020 12:02 pm

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

Post Reply