Beiträge von wpdf_user

    About use cases, i think it could enable the generation of many kind of file format based on pdf/a, not just some specific profile of factur-X.

    The pdf/a specifications about associated files (https://www.pdfa.org/resource/pdf-2…sociated-files/) explains in Chapter 3

    "an AFRelationship entry in the file specification dictionary specifying the nature of

    the relationship between the PDF (or a PDF object), and the related content. This

    entry is required to contain one of the values defined in PDF 2.0: Source, Data,

    Alternative, Supplement, EncryptedPayload, FormData, Schema or Unspecified.

    Custom values may be used where none of these entries is appropriate."

    As it is possible to specify custom values, text seems to be a good choice.

    As an example, the Order-X specifications (https://fnfe-mpe.org/factur-x/order-x/) could embed additional documents, not only the main order-x*.xml. And those additional attachments must have Supplement or Unspecified relationship.

    "Generating Order-X PDF instance

    4.1.1 Embedding the XML file

    The order data in the XML format is embedded using a file specification dictionary. In order to do

    this, a valid MIME type must be specified for the document to be embedded. The MIME type for

    Order-X is always text/xml.

    The embedded file’s stream dictionary should contain a Params key. Params refers to a dictionary

    containing at least a ModDate indicating the last modification date of the embedded file.

    The embedded document must also be included in the Names object tree so as to enable compliant

    PDF tools to represent the file together with additional information.

    As a basic principle, several files can be embedded in the PDF/A-3 document, thereby enabling

    information documents relating to the order check to be packaged together with the order data

    document in the PDF/A-3. To identify, at PDF level, which of the embedded files is the order data

    document, the name of the order data document must be included in the corresponding metadata

    attribute.

    The XML file is always embedded with the name order-x.xml.

    There is also the option to embed other documents supporting the order as additional files, including

    complementary representations of the order data in other formats (for instance EDIFACT). The name

    of a complementary representation of the order must be:

    • For an EDIFACT representation: order-xedifact.edi.

    • For a UBL representation: order-xubl.xml.

    The Data relationship must be:

    •For order-x.xml : Data, Source or Alternative

    •For other documents attached, including complementary representations: Supplement or

    Unspecified"

    Hi,

    It looks like DrawPng and DrawPngFile do not work under the delphi 7 variant of wPdf in version 4.76.

    Here is how our code look like :

    temp := TMemoryStream.Create;

    try

    png.SaveToStream(temp);

    png.SaveToFile('picture.png');

    (* PdfPrinter.DrawPNG(adaptedDrawRect.Left, adaptedDrawRect.Top,

    adaptedDrawRect.Right - adaptedDrawRect.Left,

    adaptedDrawRect.Bottom - adaptedDrawRect.Top,

    temp.Memory, temp.Size,

    true);*)

    PdfPrinter.DrawPNGFile(adaptedDrawRect.Left, adaptedDrawRect.Top,

    adaptedDrawRect.Right - adaptedDrawRect.Left,

    adaptedDrawRect.Bottom - adaptedDrawRect.Top,

    'picture.png', true);

    finally

    temp.Free;

    end;

    Any hints to solve or maybe workaround this problem ?

    Thanks for the hints.

    I have downloaded the latest version (4.71 / 16.02.2019). There is a huge improvement for horizontal text with type 3 fonts. It is probably good enough for our use case. But there is also a huge regression for vertical text (we were still using 4.33).

    Here is the rendering on screen :

    [Blockierte Grafik: https://ibb.co/TcJbnMY]

    And here is the PDF rendering with the latest version :

    [Blockierte Grafik: https://ibb.co/6m4zXQF]

    This problem is not limited to type 3 fonts. Embedded True Type fonts has the same problem. I have not yet tested other parameters.

    When using embedded type 3 font, text is always written a few pixels lower than when using embedded true type font. The problem is worth as the font size increase, to the point that it could overwrite part of the next line (if text on that line use a smaller font).

    Is it a known problem when using embedded type 3 font or is it a bug related, maybe, to baseline configuration in such fonts ?

    In my test case, the only difference is the option FontMode set to wpEmbedTrueTypeFonts or wpEmbedType3. I have some pdfs generated with the two options.