PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jun 30, 2024 11:25 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
PostPosted: Fri Jun 25, 2010 8:58 pm 
Offline

Joined: Fri Jun 25, 2010 8:37 pm
Posts: 3
Hi I am a programmer from Russia. What is the inside of his application to open and show the pdf document using PDFsharp.


Top
 Profile  
 
PostPosted: Sun Jun 27, 2010 7:37 pm 
Offline

Joined: Fri Jun 25, 2010 8:37 pm
Posts: 3
How to open saw no problem with this: PdfReader.Open(tiffPath, PdfDocumentOpenMode.Modify).
It is not clear how to show in your application Pdf document is opened using the method: PdfReader.Open.
I think there are two options for how to use them but I do not know.
Variant № 1.
Use PdfSharp.Forms.pagePreview. Here you can in the process: public void Render(XGraphics gfx)
For example:
If you specify: gfx.DrawString("The object used for drawing is the XGraphics object.", font, XBrushes.Black, x, y) - everything works well.
If you specify: PdfDocument inputDocument = PdfReader.Open(tiffPath, PdfDocumentOpenMode.Modify);
XGraphics gfx = XGraphics.FromPdfPage(inputDocument.Pages[0]); - It does not work why the element pagePreview is empty.
You like this: PdfDocument inputDocument = PdfReader.Open(tiffPath, PdfDocumentOpenMode.Modify);
XGraphics gfx2 = XGraphics.FromPdfPage(inputDocument.Pages[0]); - Just then copy gfx2 of gfx.
Variant № 2.
Use MigraDoc.Rendering.Forms.DocumentPreview.
For example:
Document document = SampleDocuments.CreateSample1();
string ddl = MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToString(document);
this.DocumentPreview.Ddl = ddl.
WriteToString requires type DocumentObject. And you can type PdfDocumen convert type DocumentObject?


Top
 Profile  
 
PostPosted: Mon Jun 28, 2010 7:35 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
RTFAQ:
http://www.pdfsharp.net/wiki/PDFsharpFA ... DF_files_3

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC


Who is online

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