PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 6:40 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Mar 26, 2010 9:35 am 
Offline

Joined: Fri Mar 26, 2010 9:17 am
Posts: 4
Images are not displayed when an XPS document is converted to PDF. I've had a quick look through the source and made the following changes to mine to fix it:

i) In the method PdfSharp.Xps.Parsing.XpsParser.ParseImageBrush immediately after the brush is created I've added the line:
brush.Opacity = 1;
It appears that the brush opacity defaults to 0 and if the opacity attribute isn't explicitly set in the xml element, the opacity always remains 0.

ii) In method PdfSharp.Xps.Rendering.PdfContentWriter in the section where the ImageBrush case is handled I've amended the boundary condition from opacity < 1 to opacity is <= 1. As it stands if both the path and brush opacities are 1 the Alpha values are never set on xgState.


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 11, 2010 7:39 pm 
Offline

Joined: Mon Oct 11, 2010 7:29 pm
Posts: 2
This fixed the issue for me as well. This seems like a simple enough fix that it could be pushed into the source.


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 04, 2010 9:23 pm 
Offline

Joined: Thu Nov 04, 2010 9:19 pm
Posts: 1
This cost me a great deal of time and trouble. Very rarely does a PDF document not contain an image of some sort. With this bug, not a single PDF document could have been produced from this source code.

Thank you very much for finding it, JEllenden, and I hope they update the source as soon as possible. This is an absolute show-stopper, so I am surprised that the issue was reported in March and the fix is still not posted in November.


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 55 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