i'm doing some test with your product.
I have a third part component that print with system printdocument class.
I need to generate a pdf.
How i can use printdocument as source and inject it to pdfdocument and write pdf file?
It is possibile?
Thank you
my sample code:
- Code: Select all
PrintDocument printDocument1 = new PrintDocument
PrintDocument printDocument1.PrintPage += new PrintPageEventHandler(PrintDocument_PrintPage);
void PrintDocument_PrintPage(object sender, PrintPageEventArgs e)
{
RectangleF printable = e.MarginBounds;
hdlView.PrintRect = new RectangleF(0, 0, printable.Width, printable.Height);
hdlView.Print(e);
}
private void btPrint_Click(object sender, EventArgs e)
{
hdlView = new MyHiddenLinesViewPrint(new HiddenLinesViewSettings(viewportLayout1.Viewports[0], viewportLayout1, 0.05, true, PenSilho, PenEdge, PenWire, false));
viewportLayout1.StartWork(hdlView);
}
private void viewportLayout1_WorkCompleted(object sender, WorkCompletedEventArgs e)
{
// here i need to create pdf from printDocument1
}