PDFsharp & MigraDoc Foundation

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

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Sep 05, 2008 1:25 pm 
Offline

Joined: Fri Sep 05, 2008 1:15 pm
Posts: 2
I'm using XpsConverter.

Everything from the original XPS file are converted but the images never appear.

This problem is my only show-stopper right now
Thanks for your great library. Exactly what I need.


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 26, 2010 9:29 am 
Offline

Joined: Fri Mar 26, 2010 9:17 am
Posts: 4
There appear to be two bugs in the code for the XPS to PDF converter when including images.

The first is that when the image brush is created from the page resources, the opacity defaults to 0.0. If the image brush has no explicit opacity defined it ends up transparent. I've fixed this by a quick and dirty hack! In the method PdfSharp.Xps.Parsing.XpsParser.ParseImageBrush immediately after the brush is created add the line:
brush.Opacity = 1;

The second is that the boundary condition for drawing the brush is incorrect. In method PdfSharp.Xps.Rendering.PdfContentWriter find the section where the ImageBrush case is handled. It sets the opacity by multiplying the opacity of the path by the opacity of the brush. It then performs a bounds check - if (opacity < 1). However, this means that if both the opacity of the path and the brush are 1 the Alpha values on the state aren't set. The bounds check should be if (opacity <= 1).

These two changes make it work for me. Hope it sorts you out too.


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: No registered users and 353 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