Export JPG/BMP on PDF

  • Hello

    I am trying to export a PDF with an image (JPG / BMP) , but the image does not appear at all.

    This image is saved in a BLOB field in my database and I use LOADFROMSTRING to load into WPRICHTEXT.

    All content loads perfectly into WPRichText, but the image is not exported.

    Below is the code I use for exporting:

    WPPDFExport1: = TWPPDFExport.Create (Self);

    WPPDFExport1.Source: = RestDWForm.WPRichText1;

    WPPDFExport1.FileName: = Params.ItemsString ['File']. AsString;

    WPPDFExport1.AutoLaunch: = False; WPPDFProperties1: = TWPPDFProperties.Create (Self);

    WPPDFProperties1.PDFPrinter: = WPPDFExport1;

    WPPDFExport1.Print;

    I'm using WPTools 7 and WPDF 4.

    Thank.

  • Thanks for the reply.

    The problem is that in the same blob field I have text just below the image, so I can't load a TPicture as suggested.

    We have been using LOADFROM STRING since Delphi 7 and have never had a problem exporting PDF, but now we are migrating applications to newer versions of Delphi.

    The interesting thing is that the RTF is perfectly generated and can save without loss of information, but when exporting to PDF it loses the image that is in the footer.

    • Offizieller Beitrag

    Yes, in Delphi 7 a string was ansi, since 2009 unicode.

    I cannot help you here, wptools can only work with the data which actually arrives. It is.not so, that loadfromstring does not work, you can actually check yourself what it does.

    If you have a blobfield, you need to create a blobstream and load from there, especially if you have embedded binary data.