View previous topic :: View next topic |
Author |
Message |
Lug16
Joined: 18 Sep 2008 Posts: 3
|
Posted: 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 |
|
Back to top |
|
|
stardust
Joined: 05 Sep 2008 Posts: 5
|
Posted: 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. |
|
Back to top |
|
|
Lug16
Joined: 18 Sep 2008 Posts: 3
|
Posted: 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... |
|
Back to top |
|
|
stardust
Joined: 05 Sep 2008 Posts: 5
|
Posted: 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. |
|
Back to top |
|
|
Lug16
Joined: 18 Sep 2008 Posts: 3
|
Posted: Wed Oct 29, 2008 6:26 am Post subject: |
|
|
Hello Again...
I've read the clock example again( http://www.pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=26&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... |
|
Back to top |
|
|
Moviaa
Joined: 23 Nov 2008 Posts: 1
|
Posted: Sun Nov 23, 2008 4:46 pm Post subject: |
|
|
Do someone know how to achieve this?
Is this at all possible with PDFSharp? |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
|
Back to top |
|
|
|