Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Oct 27, 2015 4:34 pm

Hi,
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
}

tosatoandrea
 
Posts: 1
Joined: Tue Oct 27, 2015 4:11 pm

Wed Oct 28, 2015 6:11 am

Hi,

Thanks for your interest in our Spire.PDF.
I am sorry that our Spire.PDF cannot do it at present.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2772
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF