1

I'm a beginner in Delphi, but I'm using Embarcadero for create a DLL to make a pdf report. I'm using the powerPDF component for create the report.

On my report, I have a first page, and all next pages will be the same, except a different picture.

formPDF.graphBox.width := 570;
        formPDF.graphBox.height := 343;
        formPDF.graphBox.Picture.LoadFromFile('C:\Users\rroustan\Documents\PostProcess - JMP\graphs\histogram.jpg');
        formPDF.graphBox.Repaint;

        resultFunctionMarge :=
          getMargeLeft(570, formPDF);
        formPDF.graphBox.Left := resultFunctionMarge;


        formPDF.PReport1.Print(formPDF.PRPage2);



        formPDF.graphBox.width := 350;
        formPDF.graphBox.height := 487;
        formPDF.graphBox.Picture.LoadFromFile('C:\Users\rroustan\Documents\PostProcess - JMP\graphs\boxplot.jpg');
        formPDF.graphBox.Repaint;
        resultFunctionMarge :=
          getMargeLeft(350, formPDF);
        formPDF.graphBox.Left := resultFunctionMarge;


        formPDF.PReport1.Print(formPDF.PRPage2);

My problem is when I try to print my second picture, the old picture stay and I have the same in page 2 and 3. I think I need to make a refresh of my picture but I try :

  • Refresh
  • Repaint
  • Destroy

I had check many times that the pictures have the same name, extension, etc.. But nothing change. Still have the same picture on the page 2 and 3.

Thanks per advance, Sincerely,

Romain

  • You may try using our [Synopse Pdf Engine](http://synopse.info/fossil/wiki?name=PDF+Engine) instead, which is more advanced than PowerPdf (Fonts, Uniscribe, Encryption, MetaFile, PDFA/1, PDF5), and still evolving. But it is not a set of reporting components, but a PDF renderer, from a TCanvas, or using [code generated report](http://blog.synopse.info/post/2010/06/30/Making-report-from-code). It supports JPG, bitmaps or EMF images, with advanced bitmap image re-use to minimize the size. – Arnaud Bouchez Jun 11 '15 at 11:08
  • Thanks for the proposition, but I need and I'm forced to use Power PDF. Don't have the choice :/ – romain roustan Jun 11 '15 at 11:23
  • AFAIK PowerPDF is distributed under LGPL - so [be aware of the license clauses](http://stackoverflow.com/a/10179181/458259): you should be able to *provide everything that allow the user to relink the application with a different version of the LGPL source code*. For your application, it means either distribute the source code, or allow to link PowerPDF via a dll or a package. – Arnaud Bouchez Jun 13 '15 at 16:46
  • Did you ever find the solution to this problem? I have the same problem and have not been able to find any solution for it. – Sam Jul 13 '16 at 15:37

1 Answers1

0

To reuse control TPRJpegImage with another picture you should set property SharedImage to false. For me this work :)