Home Devices

PDf is not created

edited March 2012 in Devices
Hi,

I try to print to a pdf from a dbArchiveReader component after printing
to a printer (which works fine).
That's the code I am using:

BefundReader.Reset;
BefundReader.ResetDevices;
BefundReader.DeviceType := 'PDF';
BefundReader.TextFileName := CurrentBefund.TempFilePDFBefund;
BefundReader.AllowPrintToFile := true;
BefundReader.PDFSettings.Title := 'Befund Radiologie';
BefundReader.ShowPrintDialog := false;
BefundReader.ShowCancelDialog := false;
BefundViewer.Print;

Nothing happens. No PDF is created.
CurrentBefund.TempFilePDFBefund is a valid filename

I tried to set ShowPrintDialog = true

The Dialog looks like this:

http://www.beckersoft.de/screenshots/clip7.gif

(PrintToFile = unchecked). If I check it, the pdf is printed like expected.

What could be wrong here?

Thanks and regards Uli

Comments

  • edited March 2012
    Hi Uli,

    Looking at your code, you are making a call to TppViewer.Print to export
    the report. TppViewer.Print is only to print to the printer and resets
    the devicetype accordingly (see the routine inside the ppViewr.pas and
    help topic).

    If you would like to export directly to PDF, I suggest calling the Print
    routine of the archive reader. BefundReader.Print;

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2012
    Nico,


    Oups, didn't know that.

    Thank you! Works great now.

    Regards Uli
This discussion has been closed.