Hi Gurus,
I have an application which manages some contracts.
I have the option of Printing these contracts.
For that I use PrintDocument, for preview PrintPreview.
I have a PDFcreator installed on my computer (and on the client's cumputers too).
It's fine when I show the printpreview and save it as PDF via PDFcreator.
But I would like to save the contract to PDF programmatically.
I heard it's possible to do with the PDFcreator, but after some googling couldn't find how..
I couldn't find any proper manual or documentation for pdf creator even on sourceforge.
Could you tell me how to save printdocument to PDF format, please??
Thank you very much :-)
Petr
Loading
riyan margePosted Dec 3, 2014, 1:57 AM
Riyan
FroglegPosted Dec 24, 2010, 12:23 AM
http://www.pdfsharp.com/PDFsharp/index.php?option=com_frontpage&Itemid=1
PetrPosted Dec 23, 2010, 4:03 PM
But stil, it brings uo the pdfcreator menu and options. I would like to skip that and save the printdocument as pdf directly..
Thank you
Petr
FroglegPosted Dec 23, 2010, 1:41 PM
using System.Drawing.Printing;
string pdfPrinter;//pdfcreator name
in button event
{
string strDefaultPrinter = printDocument1.PrinterSettings.PrinterName;
foreach (String strPrinter in PrinterSettings.InstalledPrinters)
{
if (strPrinter.Contains("PDF"))
{
pdfPrinter = strPrinter;
}
}
printDocument1.PrinterSettings.PrinterName = pdfPrinter;
}