PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Tue Nov 04, 2025 3:06 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  [ 3 posts ] 
Author Message
PostPosted: Mon Feb 10, 2014 7:11 am 
Offline

Joined: Mon Feb 10, 2014 6:57 am
Posts: 2
Hello,

in my application I have subclassed the MigraDoc Image class. If I add an instance of the class to a section everything works fine. However, if I add it to a paragraph, the image does not display. This can be seen using the following class

Code:
class ImageSub: Image{
   public ImageSub(string path) : base(path) {}
}


The MDDDL files generated by using the above subclass and by using the Image class are identical, so this seems like a bug in the rendering code. Is there any way to work around this limitation? I am using the GDI+ version of MigraDoc.


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 11, 2014 1:42 pm 
Offline
PDFsharp Guru
User avatar

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

What's the purpose of your subclass?

The MDDDL files are identical - so when the MDDDL is read, the normal Image class will be used and not your subclass.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 12, 2014 7:17 am 
Offline

Joined: Mon Feb 10, 2014 6:57 am
Posts: 2
I'm using a stack based approach to build PDFs from HTML, so I added interfaces and some helper methods to the subclasses to reduce the amount of type testing I have to do in my code. I did manage to work around this by using an extension method, but the behavior of not displaying the image only when it's inside a paragraph is still odd.


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

All times are UTC


Who is online

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