42 const std::filesystem::path& outputFile,
43 const std::filesystem::path& invoiceXml,
46 const std::vector<ZugferdAttachmentEntry>& attachments = {},
47 ProgressMonitor* progress =
nullptr) {
48 std::vector<std::wstring> pathStrings;
49 std::vector<std::wstring> descStrings;
50 std::vector<ZUGFeRDAttachment> cAttachments;
51 pathStrings.reserve(attachments.size());
52 descStrings.reserve(attachments.size());
53 cAttachments.reserve(attachments.size());
55 for (
const auto& a : attachments) {
56 pathStrings.push_back(a.path.wstring());
57 descStrings.push_back(a.description);
59 ca.
path = pathStrings.back().c_str();
60 ca.
description = a.description.empty() ? nullptr : descStrings.back().c_str();
61 cAttachments.push_back(ca);
64 const auto outputStr = outputFile.wstring();
65 const auto xmlStr = invoiceXml.wstring();
67 ZUGFeRDConvertParams params{};
72 params.
attachments = cAttachments.empty() ? nullptr : cAttachments.data();
75 const PDProgressMonitor* progMon = progress ? progress->monitor() :
nullptr;
76 void* progData = progress ? progress->userdata() :
nullptr;
78 PDF_CHECK_SUCCESS_X(
PDFCreateZUGFeRD(input.get(), progMon, progData, ¶ms));
PDFSDK_IMPORT_ PDErrCode PDFSDK_CALLCONV PDFCreateZUGFeRD(PDDoc source, const PDProgressMonitor *progress, void *progressData, const ZUGFeRDConvertParams *params)
Creates a ZUGFeRD/Factur-X hybrid invoice PDF/A-3b document.
void CreateZUGFeRD(const Document &input, const std::filesystem::path &outputFile, const std::filesystem::path &invoiceXml, ZUGFeRDVersion version, ZUGFeRDProfile profile, const std::vector< ZugferdAttachmentEntry > &attachments={}, ProgressMonitor *progress=nullptr)
Creates a ZUGFeRD/Factur-X hybrid invoice PDF/A-3b document.
Definition zugferd.h:41
C++ attachment entry for CreateZUGFeRD.
Definition zugferd.h:24