PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 10:24 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: Thu Aug 26, 2010 6:52 am 
Offline

Joined: Thu Aug 26, 2010 6:19 am
Posts: 2
Hi,

We are using the XPS to PDF conversion in our WPF app and while it works for the most part it seems to completely fall flat when we have shapes with matrix transformations. Rectangles tend to work, but that's about it. Our drawing pad has the ability to group shapes which then just treats multiple shapes as one shape with the standard 8 drag points in a rectangle so when that rectangle gets resized the shapes in the group get transformed via matrix transformations as shapes can be grouped, stretched, rotated, ungrouped, rotated, regrouped etc, resulting in matrices being applied on top of one another.

Below is a screenshot of an example drawing in both XPS and PDF format. The top 3 shapes in the drawing are the shapes individually. The next 3 are the shapes all grouped and then stretched out. The 3rd shape (the small one) is a pre-made grouped shape where some of the lines have had a matrix transformation applied. After that we have the result of a rectangle being rotated, then grouped with another rectangle and stretched horizontally resulting in a kind of diamond shape. This works fine. However below that is the same thing with ellipses, which doesn't work at all.

Attachment:
XPSPDFCompare.jpg
XPSPDFCompare.jpg [ 113.94 KiB | Viewed 5960 times ]


Also, is there any ETA on when the next release will come out?

Thanks
Gary Trafford


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 14, 2010 6:44 am 
Offline

Joined: Thu Aug 26, 2010 6:19 am
Posts: 2
I managed to somewhat fix this by going into private void WritePath(Path path) in PdfSharp.Xps.Rendering.PdfContentWriter.cs and adding underneath

Code:
if (path.RenderTransform != null && this.renderMode == RenderMode.Default)
      {
          MultiplyTransform(path.RenderTransform);
          WriteRenderTransform(path.RenderTransform);
      }

this code
Code:
else if (path.Data.Transform != null && this.renderMode == RenderMode.Default)
      {
          MultiplyTransform(path.Data.Transform);
          WriteRenderTransform(path.Data.Transform);
      }


This seems to work for the most part. But the line thicknesses seem to get a bit stretched and skewed at times.


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