PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 2:00 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: XGraphics.FromGraphics
PostPosted: Mon Jun 11, 2007 8:19 pm 
Offline

Joined: Mon Jun 11, 2007 7:52 pm
Posts: 1
pdfsharp team,

does XGraphics.FromGraphics works if i want to use it to replace XGraphics.FromPdfPage.

It seemed like it works differently. XGraphics i created XGraphics.FromPdfPage displayed correctly but not when i do XGraphics.FromGraphics. if it not working, what can i do if i want to save an XGraphics work to an image file instead of PDF Page.

==============================================
/// this works

public void Render(PdfPage page)
{
this.gfx = XGraphics.FromPdfPage(page);

CreateGraphics(this.gfx);
}

/// this DOES NOT, it creates an empty image
public void Render(string filename)
{
this.mergedCells = new MergedCellList(this.table);
XSize size = new XSize();
size.Width = 500;
size.Height = 500;
Bitmap bmp = new Bitmap((int)500, (int)500);
Graphics gImg = Graphics.FromImage(bmp);
gImg.Clear(Color.Transparent);

this.gfx = XGraphics.FromGraphics(gImg, size);

CreateGraphics(this.gfx);

bmp.Save(filename,System.Drawing.Imaging.ImageFormat.Jpeg);
// Save to JPEG
gImg.Dispose();
bmp.Dispose();
}


best regards,

purna


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

All times are UTC


Who is online

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