Export to PDF with ReportBuilder ppRichView
Posted: Fri May 28, 2021 6:17 pm
Hi
I work with Delphi 2007, ReportBuilder 16.02, TRichView 17.3 and I add text like this:
ppRichView1P.RichView.Clear;
ppRichView1P.RichView.Style.TextStyles.Items[0].FontName:='Monotype Corsiva';
ppRichView1P.RichView.Style.TextStyles.Items[0].Size:=15;
ppRichView1P.RichView.Style.TextStyles.Items[0].Color:=clBlack;
ppRichView1P.RichView.Style.TextStyles.Items[0].Style:=[];
ppRichView1P.RichView.Style.ParaStyles.Items[0].Alignment:=rvaJustify;
ppRichView1P.RichView.Style.ParaStyles.Items[0].LineSpacing:=100;
ppRichView1P.RichView.AddNL('TESTE DE IMPRESSÃO TESTE DE IMPRESSÃO TESTE DE IMPRESSÃO TESTE DE IMPRESSÃO TESTE DE IMPRESSÃO ',0,0);
When I send report to screen, that is ok.
ppReport.DeviceType:='Screen';
ppReport.AllowPrintToFile := False;
ppReport.ShowPrintDialog := True;
ppReport.ShowCancelDialog:=True;
ppReport.Print;
But when I try to export to PDF, text loses all formatting.
ppReport.AllowPrintToFile := True;
ppReport.ShowPrintDialog := False;
ppReport.ShowCancelDialog := False;
ppReport.TextFileName := 'Report.pdf';
ppReport.DeviceType := 'PDF';
ppReport.PDFSettings.OpenPDFFile:=True;
ppReport.Print;
Any suggestions or recommendations?
Thanks,
Cesar
I work with Delphi 2007, ReportBuilder 16.02, TRichView 17.3 and I add text like this:
ppRichView1P.RichView.Clear;
ppRichView1P.RichView.Style.TextStyles.Items[0].FontName:='Monotype Corsiva';
ppRichView1P.RichView.Style.TextStyles.Items[0].Size:=15;
ppRichView1P.RichView.Style.TextStyles.Items[0].Color:=clBlack;
ppRichView1P.RichView.Style.TextStyles.Items[0].Style:=[];
ppRichView1P.RichView.Style.ParaStyles.Items[0].Alignment:=rvaJustify;
ppRichView1P.RichView.Style.ParaStyles.Items[0].LineSpacing:=100;
ppRichView1P.RichView.AddNL('TESTE DE IMPRESSÃO TESTE DE IMPRESSÃO TESTE DE IMPRESSÃO TESTE DE IMPRESSÃO TESTE DE IMPRESSÃO ',0,0);
When I send report to screen, that is ok.
ppReport.DeviceType:='Screen';
ppReport.AllowPrintToFile := False;
ppReport.ShowPrintDialog := True;
ppReport.ShowCancelDialog:=True;
ppReport.Print;
But when I try to export to PDF, text loses all formatting.
ppReport.AllowPrintToFile := True;
ppReport.ShowPrintDialog := False;
ppReport.ShowCancelDialog := False;
ppReport.TextFileName := 'Report.pdf';
ppReport.DeviceType := 'PDF';
ppReport.PDFSettings.OpenPDFFile:=True;
ppReport.Print;
Any suggestions or recommendations?
Thanks,
Cesar