Skip to content

Cpdf and Factur-X #3748

Description

@bohwaz

I edited the wiki on Factur-X to add a working example, as it bit me that the method did not expect a full XMP file (as Prince and Weasyprint do) but just a XML string that will be included inside the existing XMP file.

Apart from that I could get my Factur-X file generated with DomPDF (after reading #3443) to be validated, so great :) (have you thought about setting up donations through Liberapay? We tried donating through Paypal, but the payment kept failing :( )

Just a small nitpick is that Cpdf::addEmbeddedFile expects a file path. But because I'm also generating the XML file in PHP, I already have it as a string, so storing it on the disk is an extra step that could cost some performance. It would be great to be able to add embedded files from strings as well. For example:

$cpdf->addEmbeddedFileFromString(
  "<?xml…",
  "factur-x.xml",
  "Invoice (Factur-X)",
  "text/xml",
  [$cpdf->catalogId => "Data"]
);

In that case I think the creation and modification date don't have to be included in the PDF header, but it's a detail.

Activity

bohwaz commented on Aug 24, 2026

@bohwaz
ContributorAuthor

See #3749 for a quick PR (untested)

changed the title [-]Cpdf[/-] [+]Cpdf and Factur-X[/+] on Aug 24, 2026

bsweeney commented on Aug 24, 2026

@bsweeney
Member

Thanks for updating the wiki. I've only paid enough attention to the feature to get it kick started so I appreciate the documentation help.

That addition sounds reasonable I'll have a look.

(have you thought about setting up donations through Liberapay? We tried donating through Paypal, but the payment kept failing :( )

I know you sent it a while ago, but I did see your message about donations. Apologies for not responding. I should give some thought to a better way to donate thanks for the push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions