PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jun 16, 2024 2:01 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Dec 10, 2010 5:27 pm 
Offline

Joined: Fri Dec 10, 2010 5:14 pm
Posts: 4
Hi,
Could anybody tell me how to show a pdf file on a win-form without use webbrowser control?
I already tried with the sample pdf-preview but I always get the same error, it's related to the pdfsharp.viewing.dll library.
Where can I find this library?
if you need more details please, just ask me.
Thank in advance.
Peter


Top
 Profile  
Reply with quote  
PostPosted: Tue Dec 14, 2010 3:26 pm 
Offline
Supporter
User avatar

Joined: Thu May 27, 2010 7:40 pm
Posts: 59
Location: New Hampshire, USA
Hello Peter,

I really would have to see the error/call stack to know what error you're seeing.

In general, this library is all about creating PDF documents and isn't a rendering engine for PDF, so a Preview would require AcroReader or something similar. If you had a PDF Viewer control that you could use in winforms, then this would be the way to go.

-Jeff


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 15, 2010 2:17 pm 
Offline

Joined: Fri Dec 10, 2010 5:14 pm
Posts: 4
Hello Jeff,
Thank you for replying,
yes I have Adobe Acrobat installed in my PC,
but I always, get this error,
The referenced assembly "..\PDFsharp\code\PdfSharp.AcroPdfLib\bin\Release\PdfSharp.Viewing.dll" was not found. If this assembly is produced by another one of your projects, please make sure to build that project before building this one. PdfViewer.Demo.
I have try to use the PagePreview page1 = new PagePreview(); but I can load a pdf on it, here is my code example.
public partial class Form1 : Form
{

PagePreview page1 = new PagePreview();

PdfDocument form;
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

form = new PdfDocument();
PdfPage page = new PdfPage();
page1.Dock = DockStyle.Fill;
//page1.na
form.Pages.Add(page);

this.Controls.Add(page1);
form.Save("vvv1.pdf");


}

}
once again thank you.
Peter


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 15, 2010 6:01 pm 
Offline

Joined: Fri Dec 10, 2010 5:14 pm
Posts: 4
Hello everyone,
I already find a solution and I want expose it here for everyone that wants load a pdf file on a winform,
in this link is the pdfsharp.viewing class that I used.
http://www.koders.com/csharp/fid0DBADF0 ... s=zoom#L95,
enjoy it.
peter


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 186 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