PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Jun 04, 2024 8:37 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Sep 18, 2008 5:11 pm 
Offline

Joined: Thu Sep 18, 2008 5:03 pm
Posts: 3
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Sep 19, 2008 5:55 pm 
Offline

Joined: Fri Sep 05, 2008 4:05 pm
Posts: 5
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Sep 19, 2008 7:50 pm 
Offline

Joined: Thu Sep 18, 2008 5:03 pm
Posts: 3
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...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Sep 21, 2008 8:10 am 
Offline

Joined: Fri Sep 05, 2008 4:05 pm
Posts: 5
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 29, 2008 6:26 am 
Offline

Joined: Thu Sep 18, 2008 5:03 pm
Posts: 3
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...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Nov 23, 2008 4:46 pm 
Offline

Joined: Sun Nov 23, 2008 4:41 pm
Posts: 1
Do someone know how to achieve this?
Is this at all possible with PDFSharp?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 24, 2008 9:07 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3099
Location: Cologne, Germany
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

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 51 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group