TilingPatternBuilder Fixes
Hey I've been working recently on pdfsharp and was very thankful to find this repo with so many nice fixes to the xps code. However I've been having issues with images, I've worked out a fix through stubbornness it may not be the most elegant though so I've forked and put my fixes in my fork. You may want to have a look, I've included an example xps to illustrate the issue (any image cropped in word and then printed to xps will do it though)
https://github.com/ken-sands/PdfSharp.XPS
I've added more samples to the project(also included yours). Your code change works for the crop_example.xps, but has some exceptions on other xps files.
Yeah, I've noticed that. the cropped bitmap doesn't like the cmyk example. I'm not sure what to do about that. however for that example there is no crop so it can be made more compatible by only applying my code when the viewbox x or y are not 0. I think the real solution is in getting the matrix values correct but as I said I went round and round with that and just lost my head. I've updated my code so it works with more examples.
I think the part that was making it difficult for me to get the matrix right was due to the dpi difference in the viewbox compared to the vieport. in my example the png is 220dpi, the viewbox works in that while the viewport works with the 96dpi of the... output? trying to get my head around the order in which things applied was just too much. Hopefully I've helped enough that someone can work it out!