WPCubed GmbH
Wordprocessing and PDF components 

About PDF/A Support

The property PDFAMode enables PDF/A support with wPDF.

Values: wpdfaOff or wpdfaLevelA

PDF/A is a new which based on PDF 1.4 - it was created to provide a guildline for the creation of document files which stay readable for the time to come. So the major demand for PDF/A complient files is that the used font files are embedded. Security measures are forbidden in PDF/A complient files as are links to external files.

 

But there is more to PDF/A. We have checked the component carefully against the final documentation of PDF/A.

 

When you use WPTools (from version 6)to create the PDF files additional (invisible) tags can be added to the PDF data.

 

This tags make it possible to identify layout elements (such as header or footer texts) on a page. They can be also used by a PDF reader to convert the PDF data into text paragraphs, something which is otherwise at least difficult and impossible if a paragraph spans a page. The wPDF engine will also create tags to mark table cells.

wPDF will also add the document information as XMP data to the PDF file.

 

Modern Invoices also uses PDF/A. They also include XML Data which represents the values printed in the PDF (X-Factur / ZUGFeRD).

 

Using our tool WPXOrder you can create such XML Data.

 

Using wPDF, our universal PDF creator VCL You can not only create the PDF/A format but also add metadata and the XML Attachment:

 

mem := TMemoryStream.Create;
try
       WPPDFExport1.FileName := PDFName.Text;
       WPPDFExport1.AutoLaunch := false;
       WPPDFExport1.CompressStreamMethod := wpCompressFlate;
       WPPDFExport1.Source.ReformatAll(true);
       WPPDFExport1.Source.ReformatAll(true);
       WPPDFExport1.FontMode := wpEmbedCIDFonts;

       OrdersINVOICEXML.SaveToStream(mem);
       mem.Position := 0;

       if mem.Size>0 then
       begin
          WPPDFExport1.PDFAMode :=  wpdfaLevel3B;
          lst := TStringList.Create;
          s :=  Format( pdfa_xfactur_info, [pdfa_xfactur_filename,'EXTENDED'] );
          WPPDFExport1.AddXMPExtra( pdfa_xfactur_schema, s  );
          lst.Free;
       end;
       WPPDFExport1.BeginDoc;
       try
           WPPDFExport1.AddFileAttachment(
                         pdfa_xfactur_filename, 
                         pdfa_xfactur_description, 
                         mem, 'text/xml', now, [wpDontCompressData]);
           WPPDFExport1.Print;
       finally
             WPPDFExport1.EndDoc;
       end;
finally
     mem.Free;
end;

 

The code above uses this variables:

pdfa_xfactur_schema :=
   '<rdf:li rdf:parseType="Resource">' + #10 +
                  '<pdfaSchema:schema>Factur-X PDFA Extension Schema</pdfaSchema:schema>' + #10 +
                  '<pdfaSchema:namespaceURI>urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#</pdfaSchema:namespaceURI>' + #10 +
                  '<pdfaSchema:prefix>fx</pdfaSchema:prefix>' + #10 +
                  '<pdfaSchema:property>' + #10 +
                     '<rdf:Seq>' + #10 +
                        '<rdf:li rdf:parseType="Resource">' + #10 +
                           '<pdfaProperty:name>DocumentFileName</pdfaProperty:name>' + #10 +
                           '<pdfaProperty:valueType>Text</pdfaProperty:valueType>' + #10 +
                           '<pdfaProperty:category>external</pdfaProperty:category>' + #10 +
                           '<pdfaProperty:description>name of the embedded XML invoice file</pdfaProperty:description>' + #10 +
                        '</rdf:li>' + #10 +
                        '<rdf:li rdf:parseType="Resource">' + #10 +
                           '<pdfaProperty:name>DocumentType</pdfaProperty:name> ' + #10 +
                           '<pdfaProperty:valueType>Text</pdfaProperty:valueType>' + #10 +
                           '<pdfaProperty:category>external</pdfaProperty:category>' + #10 +
                           '<pdfaProperty:description>INVOICE</pdfaProperty:description>' + #10 +
                        '</rdf:li> ' + #10 +
                        '<rdf:li rdf:parseType="Resource"> ' + #10 +
                           '<pdfaProperty:name>Version</pdfaProperty:name>' + #10 +
                           '<pdfaProperty:valueType>Text</pdfaProperty:valueType>' + #10 +
                           '<pdfaProperty:category>external</pdfaProperty:category>' + #10 +
                           '<pdfaProperty:description>The actual version of the ZUGFeRD data</pdfaProperty:description>' + #10 +
                        '</rdf:li>' + #10 +
                        '<rdf:li rdf:parseType="Resource">' + #10 +
                           '<pdfaProperty:name>ConformanceLevel</pdfaProperty:name>' + #10 +
                           '<pdfaProperty:valueType>Text</pdfaProperty:valueType>' + #10 +
                           '<pdfaProperty:category>external</pdfaProperty:category>' + #10 +
                           '<pdfaProperty:description>The conformance level of the ZUGFeRD data</pdfaProperty:description>' + #10 +
                        '</rdf:li>' + #10 +
                     '</rdf:Seq> ' + #10 +
                  '</pdfaSchema:property>' + #10 +
               '</rdf:li>';

// First %s for filename, second %s for EXTENDED/BASIC
pdfa_xfactur_info :=
   '<rdf:Description xmlns:fx="urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#"' + #32 + 'rdf:about="">' + #10 +
   '<fx:DocumentType>INVOICE</fx:DocumentType>' + #10 +
   '<fx:DocumentFileName>%s</fx:DocumentFileName>' + #10 +
   '<fx:Version>1.0</fx:Version>' + #10 +
   '<fx:ConformanceLevel>%s</fx:ConformanceLevel></rdf:Description>' + #10;
        //      above are real values, should be dynamically created
pdfa_xfactur_LEVEL := 'EXTENDED';
pdfa_xfactur_filename := 'factur-x.xml';
pdfa_xfactur_description := 'Factur-X/ZUGFeRD Rechnung';