PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

How to create a Pdf from an asp page
https://forum.pdfsharp.net/viewtopic.php?f=2&t=482
Page 1 of 1

Author:  Lug16 [ Thu Sep 18, 2008 5:11 pm ]
Post subject:  How to create a Pdf from an asp page

Hello everyone:

I'm understanding the PdfSharp library and I want to create a PDF from a existing ASP page in my application, I've read the clock example, and I dont know how to create the pdf from the current page (with images and styles).

Any help will be grateful

Thank you

Author:  stardust [ Fri Sep 19, 2008 5:55 pm ]
Post subject: 

Havn't had a look at the Clock example yet, but I would imagine you need to parse the HTML in the redendered asp page and translate the parsed HTML document into a PDF.

Sounds like what I am trying to do but I havn't got a page to begin with, all I have is data from databases.

Author:  Lug16 [ Fri Sep 19, 2008 7:50 pm ]
Post subject: 

stardust wrote:
Havn't had a look at the Clock example yet, but I would imagine you need to parse the HTML in the redendered asp page and translate the parsed HTML document into a PDF.

Sounds like what I am trying to do but I havn't got a page to begin with, all I have is data from databases.


Thanks for the answer...
Do you have any example to follow?
Thank you...

Author:  stardust [ Sun Sep 21, 2008 8:10 am ]
Post subject: 

I don't have any example for you because there are so many ways to parse HTML into some kind of Object collection which is application specific. What you can do is try to look at some example of parsing XML and get some ideas from those.

Once you have the Object representation of the HTML document, you then need to defind some rules how to translate those objects into PdfSharp object or using the DOM objects from MigraDoc API.

For example:
If you have translated a <p> into a customParagraph object, then you can translate it into the Paragraph object in MigraDoc. Then assign the content of the <p> tag as the text of the Paragraph.

Of coz you need to take into account of tags can be nested.

Author:  Lug16 [ Wed Oct 29, 2008 6:26 am ]
Post subject: 

Hello Again...

I've read the clock example again( http://www.pdfsharp.com/PDFsharp/index. ... &Itemid=36 ) and it looks like the whole asp page is converted to a MemoryStream object.
The clock is created with de XGraphics functions and the stream is loaded with it.
But I really try to get the stream data from my current page in asp(without any XGraphics creation, just a repeater with some information) and load it in the pdfDocument but it just create an empty pdf file...

I hope your help in this issue...

Thanks for your replies...

Author:  Moviaa [ Sun Nov 23, 2008 4:46 pm ]
Post subject: 

Do someone know how to achieve this?
Is this at all possible with PDFSharp?

Author:  Thomas Hoevel [ Mon Nov 24, 2008 9:07 am ]
Post subject: 

Moviaa wrote:
Do someone know how to achieve this?
Is this at all possible with PDFSharp?

Stardust gave you the answer:
viewtopic.php?p=1107&mforum=pdfsharp#1107

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/