PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

within your application to open and display a pdf document
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1234
Page 1 of 1

Author:  Artur [ Fri Jun 25, 2010 8:58 pm ]
Post subject:  within your application to open and display a pdf document

Hi I am a programmer from Russia. What is the inside of his application to open and show the pdf document using PDFsharp.

Author:  Artur [ Sun Jun 27, 2010 7:37 pm ]
Post subject:  Re: within your application to open and display a pdf document

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?

Author:  Thomas Hoevel [ Mon Jun 28, 2010 7:35 am ]
Post subject:  Re: within your application to open and display a pdf document

RTFAQ:
http://www.pdfsharp.net/wiki/PDFsharpFA ... DF_files_3

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/