PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jul 18, 2024 9:26 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: XGraphics.FromGraphics
PostPosted: Tue Jul 07, 2015 3:15 pm 
Offline

Joined: Tue Jul 07, 2015 2:53 pm
Posts: 2
I found no samples about the method XGraphics.FromGraphics(Graphics, XSize), so I donĀ“'t no what's the scaling and which size I should use.
Further I hoped with the returned XGraphics object of the method I could create an pdf-file, but found no way.
The only Thing I could do whith it was painting to the Graphics with XGraphics Methods, but this was not my intention.
Please can you explain this.
Best regards!


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 07, 2015 4:24 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 951
Location: CCAA
Hi!
freica97 wrote:
The only Thing I could do whith it was painting to the Graphics with XGraphics Methods
That's what it is made for.

You can get an XGraphics object for a PDF page to draw on PDF. And you can use XGraphics.FromGraphics to use the same XGraphics routines to draw on the screen (e.g. preview) or a printer.

The Preview sample uses this.
http://pdfsharp.net/wiki/Preview-sample.ashx

Download the PDFsharp source package to get the complete source code.
http://pdfsharp.codeplex.com/releases

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 08, 2015 9:40 am 
Offline

Joined: Tue Jul 07, 2015 2:53 pm
Posts: 2
Hi,
thank you for the Response. Ok I download the sourcecode with all of the samples and I see what you mean. Yesterday I only read the code of the sample (Line 1..Line 81) at the Website and there I don't see something about Preview or XGraphics.FromGraphics so I could not understand the relations.

Best regards.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 38 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