PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

A document generated by MigraDoc is viewed strangely on Java
http://forum.pdfsharp.com/viewtopic.php?f=2&t=807
Page 1 of 1

Author:  sephil [ Sun Jul 26, 2009 9:27 am ]
Post subject:  A document generated by MigraDoc is viewed strangely on Java

A PDF document that was created by MigraDoc is read, later, by Java application in order to view it on a Swing frame and print it.
The text lines in both cases appear rotated by 180 degrees, while the images are OK.
What could be the reason for this strange behavior?

Attachments:
File comment: A snapshot of the twisted PDF.
RotatedText.JPG
RotatedText.JPG [ 47.09 KiB | Viewed 5892 times ]

Author:  Thomas Hoevel [ Mon Jul 27, 2009 9:08 am ]
Post subject:  Re: A document generated by MigraDoc is viewed strangely on Java

I presume the file looks correct when viewed with Adobe Reader?
If so, the Java application is not fully PDF compatible.
(If Adobe Reader also shows the file incorrectly, please submit a sample file.)

Are you using the GDI+ build? If so, please try the WPF build.
Are you using the WPF build? If so, please try the GDI+ build.

Author:  sephil [ Tue Jul 28, 2009 12:02 pm ]
Post subject:  Re: A document generated by MigraDoc is viewed strangely on Java

Acrobat Reader displays the files correctly because it is more tolerant.
I tried three different Java libraries and they all showed the text lines rotated.
I'm checking which build is used on the .Net side and will post an answer shortly.

Author:  Thomas Hoevel [ Tue Jul 28, 2009 12:54 pm ]
Post subject:  Re: A document generated by MigraDoc is viewed strangely on Java

sephil wrote:
Acrobat Reader displays the files correctly because it is more tolerant.

Not "more tolerant".
PDF is complicated. Some PDF viewers are limited.
Adobe Reader shows the files correctly, GhostScript Viewer shows the files correctly.

PDF files can use several mapping modes/transformations.
BMP files can either be top-down or bottom-up - if an application only knows the default case, it will show "non-default" files the reversed.
Same here for PDF.

IIRC the files created with the WPF build use the standard transformation.
I include two files for testing.

Attachments:
File comment: File created with WPF build.
Invoice_WPF.zip [100.12 KiB]
Downloaded 323 times
File comment: File created with GDI+ build.
Invoice_GDI.zip [100.58 KiB]
Downloaded 335 times

Author:  sephil [ Tue Jul 28, 2009 1:08 pm ]
Post subject:  Re: A document generated by MigraDoc is viewed strangely on Java

I tried the files. Both were displayed the same way, with the text upside down. The table image and the logo are correct.
Is there a way to generate default mapping files?
Do you want me to send a small Java program so that you can see the results for yourself?

Author:  Thomas Hoevel [ Tue Jul 28, 2009 1:31 pm ]
Post subject:  Re: A document generated by MigraDoc is viewed strangely on Java

sephil wrote:
Is there a way to generate default mapping files?

I don't know (not my area of expertise).

sephil wrote:
Do you want me to send a small Java program so that you can see the results for yourself?

I'm not sure if our experts need that program to solve this compatibility issue. We'll get back to you if we need it. Thanks for your offer.

Author:  sephil [ Tue Jul 28, 2009 1:43 pm ]
Post subject:  Re: A document generated by MigraDoc is viewed strangely on Java

Thank you very much for trying to help.
For your information, I tried the following Java libraries to render the PDFSharp output files:
PDFRenderer, ICEpdf and PdfBox.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/