-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Produce Facture-x/ZUGFeRD invoices | Port reference from upstream repo #2924
Comments
Update: Turns out the issue is related to the fontkit upgrade. Using [email protected] like the upstream repo works. Not sure how to proceed. Maintainers, please advise. I implemented everything for Facture-x / ZUGFeRD compliance (see screenshot). <Document
attachments={[
{
content: exampleXml,
creationDate: new Date(2020, 3, 1),
description: 'ZUGFeRD Invoice Data',
hidden: false,
modifiedDate: new Date(2020, 3, 1),
name: 'zugferd-invoice.xml',
relationship: 'Alternative',
type: 'application/xml',
},
]} // new prop to add PDF attachments
author="Test GmbH"
creationDate={new Date()}
creator="Test GmbH"
keywords="test"
onRender={onRender}
pdfVersion="1.7"
producer="Test"
subject="Test"
subset="PDF/A-3" // new prop to specify PDF subset
tagged // new props to specify whether PDF should be tagged or not, necessary for PDF/A3 compliance
title="Test"
>
<Page>
<Text style={{ fontFamily: 'Inter' }}>Lorem</Text>
<Xml value={`some XML metadata, shortened for brevity`}/>
</Page>
</Document> |
Thanks for working on this, @florianbepunkt! And for the ping - I've ran into font issue as well for my PR, so I'm curious and excited that you were able to fix the issues by downgrading |
@klimeryk It might be good to check the whole commit history (it's not huge), but I was not 100% sharp in aligning my commits, as there was some back and forth. Reverting to |
@klimeryk Interesting find... I think I found the underlying issue. Missed a small point when checking fontkit's release notes (unfortunately they don't have a proper changelog):
I believe the fix is to simply change this line
from
to
The interesting part: How the heck did this work before?? I honestly have no clue. But with this change we should be good to go. This should solve the font issue in your PR as well. Can you check? I would wait if we hear something from the maintainer, so we can finish this PR. |
Big props to @florianbepunkt for spotting this solution. See diegomura#2924 (comment)
Big props to @florianbepunkt for spotting this solution. See diegomura#2924 (comment)
Awesome find, @florianbepunkt! I've tested with my PR and it indeed fixes the font issue! 💖 See klimeryk@16f1475. |
This is neither a feature report / nor bug request.
Goal
Use react-pdf to issue electronic invoices (Facture-x / ZUGFeRD). This requires attaching XML data, adding some XMP markup and a valid PDF/A3 pdf.
Contribute back / my issue
To implement this I forked this repo and I would like to contribute back, as a lot of changes involve #2613.
Basically I ported the the new reference class from the upstream pdfkit repo.
This works fine except one issue: When adding custom fonts, they look like this (there should be one word "Lorem"):
@diegomura Do you have any idea what might be happening here? The issue must be somewhere at the intersection between the upstream repo's new reference class and how custom fonts are embedded. Maybe there is some overlap with PR in #2696 by @klimeryk
Further implementation
Once the issue can be resolved and all tests run, I can split work into several more granular PRs. I have a prototype with these features implemented.
The text was updated successfully, but these errors were encountered: