Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I guess you want your application to create some PDF content from User Interface field.</p> <p>You can do this easily from code, using a report generator from code, then a <a href="http://blog.synopse.info/category/Open-Source-Projects/Synopse-PDF-engine" rel="nofollow">PDF engine</a>.</p> <p>We propose an <a href="http://blog.synopse.info/post/2010/06/30/Making-report-from-code" rel="nofollow">Open Source solution just for doing this</a>, from Delphi 6 up to XE.</p> <p>Here is a <a href="http://synopse.info/forum/viewtopic.php?id=41" rel="nofollow">code extract from one demo</a>, which create a reports, using some User Interface fields as source (e.g. edt1.Text or mmo1.Text):</p> <pre><code>procedure TForm1.btn1Click(Sender: TObject); (...) with TGDIPages.Create(self) do try // the name of the report is taken from main Window's 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; </code></pre> <p>There are other solutions around, but this one is Open Source, and you can even draw whatever you want to the report (using a "standard" TCanvas property - you can even directly any graphical component using the PaintTo method), not only dedicated report generated methods like DrawTitle() or DrawText().</p> <p><em>EDIT:</em></p> <p>If your question was about creating PDF files with forms, this library won't work.</p> <p>You should use some closed-source libraries like <a href="http://www.verypdf.com/pdfform/index.html" rel="nofollow">VeryPdf</a> or <a href="http://help.quickpdflibrary.com/questions/794/formfields-fill-in-problems-with-an-existing-pdf-file" rel="nofollow">QuickPdf</a>. <a href="http://www.google.at/search?q=PDF+fill-in+delphi" rel="nofollow">Google is your friend</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload