PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Fri Nov 07, 2025 9:34 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: DocumentPreview in WPF
PostPosted: Tue Jul 16, 2013 2:19 pm 
Offline

Joined: Tue Jul 16, 2013 2:10 pm
Posts: 1
Hi!

I'm working with the WPF build of MigraDoc and PDFSharp 1.32. Due to the "lock files" bug I am considering moving to the GDI+ build.
But somehow when I try to include the DocumentPreview
Code:
MigraDoc.Rendering.Forms.DocumentPreview
I get nothing. I call the following in the constructor:
Code:
this.Document = new Document();
// Create the document
// [...]
string ddl = MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToString(this.Document);
this.DocumentPreview = new DocumentPreview();
this.GroupBox.Content = this.DocumentPreview;
this.DocumentPreview.Ddl = ddl;
But nothing happens, no error, no warning, no control which is shown.
So what I am looking for is either to get the DocumentPreview from GDI+ working in my WPF/XAML application or a workaround for the "lock files" bug. Any ideas?

Best regards
Yves


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 18, 2013 12:15 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3136
Location: Cologne, Germany
Hi!

Difficult to tell the problem with just a code snippet.

When using a WinForms dialog, just add DocumentPreview in the designer.

When using a WPF dialog, you need a WindowsFormsHost somewhere AFAIK - and I don't see that in your snippet.

See also:
http://msdn.microsoft.com/en-us/library/ms751761.aspx

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 87 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