Recent

Author Topic: PDFexport trick  (Read 2658 times)

mirce.vladimirov

  • Full Member
  • ***
  • Posts: 220
PDFexport trick
« on: March 30, 2013, 11:26:38 pm »
Happy to announce:
Lazarus community can convert Lazreports to PDF even if UTF8 coding is used  ;)
Just follow these steps:
1.Install the free software named PDFCreator from http://www.pdfforge.org (or any similar that you prefer)
2.During designing a Lazreport : File->ReportOptions->Printer->PDFCreator
3.In your code :
Code: [Select]

  frReport1.LoadFromFile('proba_pdf.lrf');
  frReport1.PrepareReport;
  frReport1.PrintPreparedReport('1-99999',1);
Just to remind:  frReport1.PrintPreparedReport requires two parameters, first is string and represents the page range, the second is integer and represents the number of copies. The "prepareReport" and "PrintPreparedReport" provide that the report is sent to the default printer which we did in step number 2.

Thats all.

mirce.vladimirov

  • Full Member
  • ***
  • Posts: 220
Re: PDFexport trick
« Reply #1 on: March 30, 2013, 11:32:43 pm »
Quote
Thats all.

One more thing: This way your application is not stand-alone anymore, this way it is dependable on the PDFCreator (or similar software that you prefer), you must warn your users about this.