Thank for the info. Is there any documentation/example so I could evaluate the trial version?
#4
♥ 0
Thank for the info. Is there any documentation/example so I could evaluate the trial version?
Hi,
it is not possible to convert PDF using wPDF, wPDF only creates new PDF files.
WPViewPDF V5 can exchange the XMP metadata now. This means you can add new XMP metadata.
I would like to convert PDF/A-1 file to PDF/A-3 so it conforms to Zugferd specification. I tried to accomplish that using wPDF:
pdfa_xfactur_LEVEL := 'EXTENDED';
pdfa_xfactur_filename := 'factur-x.xml';
pdfa_xfactur_description := 'Factur-X/ZUGFeRD Rechnung';
mem := TMemoryStream.Create;
PDFPrinter := TWPPDFPrinter.Create(nil);
try
mem.LoadFromFile('test.xml');
lst := TStringList.Create;
s := Format( pdfa_xfactur_info, [pdfa_xfactur_filename,'EXTENDED'] );
lst.Free;
// Load existing PDF/A-1 file
PDFPrinter.InputFile := 'test.pdf';
PDFPrinter.InputfileMode := pwAppendToInput; // Use existing PDF as base
PDFPrinter.PDFAMode := wpdfaLevel3B; // PDF/A-3 Level B
PDFPrinter.FileName := 'test-pdf-a-3.pdf';
PDFPrinter.CompressStreamMethod := wpCompressFlate;
PDFPrinter.AddXMPExtra( pdfa_xfactur_schema, s );
// Start PDF creation
PDFPrinter.BeginDoc;
PDFPrinter.AddFileAttachment(
pdfa_xfactur_filename,
pdfa_xfactur_description,
mem, 'text/xml', now);
PDFPrinter.EndDoc;
finally
PDFPrinter.Free;
mem.Free;
end;
To create this code I adapter the example from https://www.wpcubed.com/pdf/products/wpdf/pdfa/.
When I try to validate the resulting file with verapdf I receive the errors:
<rule specification="ISO 19005-3:2012" clause="6.2.4.3" testNumber="2" status="failed" failedChecks="1869">
<description>DeviceRGB shall only be used if a device independent DefaultRGB colour space has been set when the DeviceRGB colour space is used, or if the file has a PDF/A OutputIntent that contains an RGB destination profile</description>
and
<check status="failed">
<context>root/document[0]/pages[0](7 0 obj PDPage)/contentStream[0](8 0 obj PDContentStream)/operators[2]/colorSpace[0]</context>
<errorMessage>DeviceRGB colour space is used without RGB output intent profile</errorMessage>
</check>
Is the scenario of converting PDF/A-1 to PDF/A-3 actually possible with wPDF?
Thanks