#1 PDF Engine » problems by creating PDF File from TMS RichEdit » 2017-01-12 09:02:43

hunni
Replies: 0

Hi,


I'm new to SynPDF

I have some problems by creating a PDF File from TMS RichEdit (using AdvRichEditorRTFIO).
My PDF File is always emply

I'm using following Code to hand over the RTF from AdvRichEdit

    AppendRichEdit(AdvRichEditorRTFIO1.RichEditor.Handle);


The Result is always an PDF File only with Header and Footer but without the RTF Text

No Error is shown



Sample program
procedure TForm1.FormShow(Sender: TObject);
begin
  AdvRichEditorRTFIO1.load('d:\1.rtf');
end;

procedure TForm1.btnPDFClick(Sender: TObject);
begin
  with TGDIPages.Create(self) do
  try
    Caption := 'SynPDF RichEdit Print Preview & PDF Creation';
    BeginDoc;
    SaveLayout;
    Font.Size := 9;
    AddTextToHeaderAt(Caption,LeftMargin);
    TextAlign := taRight;
    AddTextToHeader(DateTimeToStr(Now));
    AddLineToHeader(true);
    TextAlign := taLeft;
    AddLineToFooter(true);
    AddPagesToFooterAt('Page %d/%d',LeftMargin);
    TextAlign := taRight;
    AddTextToFooterAt('-=- Test Right click on the report then "Export as PDF" -=-',RightMarginPos);
    RestoreSavedLayout;
    DrawTitle('Rich Edit Content',true);
    AppendRichEdit(AdvRichEditorRTFIO1.RichEditor.Handle);
    DrawTitle('Last page content',true);
    NewHalfLine;
    DrawText('We are also able '+
      'to know at where Y position the RichEdit content was finished printing....'#13+
      'Therefore, any further writing to the report continue to the same page.');
    EndDoc;
    ExportPDF('d:\qqq.pdf',true,false);
    ShowPreviewForm;
  finally
    Free;
  end;
end;



regards

Torsten

Board footer

Powered by FluxBB