Le 18/04/2021 à 17:22, James Richters via fpc-pascal a écrit :
RE: [fpc-pascal] Directory Tree
I figured out how to make a pdf file, but I don’t know how to
implement it… if we can just have a button to print result.txt… then I
could just change the printer to Microsoft Print to PDF which is
included with Widows 10….
There is a Freepascal utility for converting a text file to pdf.
Supposing your lazarus is installed at c:\lazarus, it 'll be at
C:\lazarus\fpc\3.2.0\source\packages\fcl-report\demos\txt2pdf.lpi
It doesn't display the correct chars if you compile and execute it
directly on Result.txt on the command line.
But I've included the source code from this project and modified the
code to produce the pdf.
I've had trouble with the fonts but it seems to works reasonably well
with DejaVuSans.
It's not the ideal font, but box characters are displayed relatively
correctly.
I'm not 100% sure it will work for you.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal