I am very happy now, thats why are these smiles for.
This is helpful to all Lazarus programers that create reports with non-latin character set, like cyrilics, Chinese, Greek, Arabic... LazreportToPDF doesnt support these charsets, displays "????" instead of letters, so we had to improvise. I believe you will like this improvisation as much as I liked it.
Very often we need to convert large number of Lazreports to PDF and so far my application was not able to do that dynamicaly, instead I was using the PDF Creator for that. But it is realy boring repeating all the "click Save", "select folder", "save as" etc etc... sometimes my clients had to export 10-15 documents in a row, which was realy pain in the ass.
But tonight i've just found out the PDFCreator's feature to have diferent profiles plus setting a default profile !!
Do this :
1.Start the PDFCreator
2.Under "Printer" click "Options"
3.A separate form will be opened, click the "+" like in the attached named "pdf2.png" attached to this post
4.New profile will be created, you can change its name according to your favour.
5.Now set the "auto-save" options like in the attached "pdf3.png"
5.Then close that form and return to the main form, click "printer" and selec "printers", a new form will open which looks like the attached "pdf4.png", here you can change your favourite profile to be used as default one.
And thats it. Now in my application if user selects the printer named "PDFCreator" a Lazreport is converted to PDF silently and it's located in the predefined folder. When printing reports continously into separate PDF Files i do (assuming that on clients computer the PDFCreator was installed) :
i:=0;
for i:=0 to printer.Printers.Count-1 do begin
if pos('PDFCreator', printer.printers[i] )>0 then begin
printer.PrinterIndex:=i;
break;
end;
end;
frReport1.Clear;
frReport1.LoadFromFile('vopdf1.lrf');
if frReport1.PrepareReport then begin
frReport1.PrintPreparedReport('1-9999',1);
end;
end;
Now its easy to convert many reports to PDF docs one after another without bothering the client.