Jump to content

Creating a PDF from within UniGUI


Woutero

Recommended Posts

41 minutes ago, Woutero said:

Hi Sherzod

Can you or anyone else recommend a PDF library/component that works well with UniGUI?

I would like to export some graphs from a UniChart to a pdf.

Hi, why dont use just print to Windows PDF printer and show saved (printed) document to user?

https://stackoverflow.com/questions/25371291/print-a-string-directly-to-printer

https://www.delphibasics.co.uk/Article.php?Name=Printing

 

https://www.google.com/search?q=delphi+print+to+printer&oq=delphi+print+to+printer&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIICAEQABgWGB7SAQg1Njg4ajBqN6gCALACAA&sourceid=chrome&ie=UTF-8

Link to comment
Share on other sites

3 hours ago, irigsoft said:

Irigsoft

So when one select, Print to PDF via the Delphi PrintDialog (see below), where is the PDF file saved?

Or rather, how can I set the folder where the PDF is saved?

 

image.png.aaa65b7d4fb7b916487edab868e7c83e.png

 

Link to comment
Share on other sites

40 minutes ago, Woutero said:

Irigsoft

So when one select, Print to PDF via the Delphi PrintDialog (see below), where is the PDF file saved?

Or rather, how can I set the folder where the PDF is saved?

 

image.png.aaa65b7d4fb7b916487edab868e7c83e.png

 

Hi, I give you example how to do it with delphi, but you can find more examples and try to print directly without PrintDialog (because dialog shown on server side and can't be usefull)

@Woutero, here is some kind of examples:

https://forum.lazarus.freepascal.org/index.php?topic=47640.0

Printer.SetPrinter('Microsoft Print To PDF');
    Printer.Copies:=1;
//    PrintDialog1.PrintToFile:=true;
//    Printer.FileName:=suggestFileName()+'.pdf';
    doPrint();

 

"For me your code is working. Please see attached demo. It checks whether the "Microsoft print to PDF" printer is available, selects it and sets the filename by setting the FileName property. (When the printer is not found it opens the PrintDialog)."

https://forum.lazarus.freepascal.org/index.php?PHPSESSID=lhgjmk83bcjm7trnihen5tbt77&action=dlattach;topic=47640.0;attach=34509

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...