Sending data to PDF using Delphi

Is there a way to send data to my PDF file (fill in the fields / spaces) manually or with a third-party component, PDF files have certain fields that can be changed by the user, input numbers .. checkboxes, etc. etc.

How can I achieve this if it requires some kind of third-party component that is the best, and what are the prices?

our development IDE - delphi 2010 / Delphi 2011 XE

thank:)

+3
source share
1 answer

I assume that you want your application to create some PDF content from a user interface field.

You can do this easily from code using the report generator from code, then the PDF engine .

, Delphi 6 XE.

, , (, edt1.Text mmo1.Text):

procedure TForm1.btn1Click(Sender: TObject);
  (...)
    with TGDIPages.Create(self) do
    try
      // the name of the report is taken from main Window caption
      Caption := self.Caption;
      // now we add some content to the report
      BeginDoc;
      (...)
      // main content (automaticaly split on next pages)
      NewHalfLine;
      TextAlign := taJustified;
      s := 'This is some big text which must be justified on multiple lines. ';
      DrawText(s+s+s+s);
      NewLine;
      TextAlign := taLeft;
      DrawTitle(edt1.Text,true);
      for i := 1 to 10 do
        DrawText('This is some text '+IntToStr(i));
      NewLine;
      DrawBMP(Bmp,maxInt,50,'Some bitmap in the report');
      AddBookMark('bookmarkname');
      WordWrapLeftCols := true;
      AddColumns([10,20,50]);
      AddColumnHeaders(['#','Two','Three'],true,true);
      for i := 1 to 100 do
        DrawTextAcrossCols([IntToStr(i),'Column '+IntToStr(i),'Some text here. '+s]);
      NewLine;
      DrawBMP(Bmp,maxInt,50,'Some bitmap in the report (twice)');
      DrawTitle('This is your text',false,0,'','bookmarkname');
      DrawText(mmo1.Text);
      EndDoc;
      // set optional PDF export options
      // ExportPDFForceJPEGCompression := 80;
      // ExportPDFEmbeddedTTF := true;
      // ExportPDFUseUniscribe := true;
      // ExportPDFA1 := true;
      // show a preview form, and allow basic actions via the right click menu
      // ShowPreviewForm;
      // export as PDF
      ExportPDF('test.pdf',false);
    finally
      Free;
    end;

, Open Source, , ( "" TCanvas - PaintTo), , DrawTitle() DrawText().

EDIT:

PDF , .

, VeryPdf QuickPdf. Google - .

+2

Source: https://habr.com/ru/post/1788959/


All Articles