PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 10:05 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sun Jul 26, 2009 9:27 am 
Offline

Joined: Sun Jul 26, 2009 9:19 am
Posts: 4
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 5432 times ]


Last edited by sephil on Tue Jul 28, 2009 11:57 am, edited 2 times in total.
Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 27, 2009 9:08 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 28, 2009 12:02 pm 
Offline

Joined: Sun Jul 26, 2009 9:19 am
Posts: 4
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 28, 2009 12:54 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
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 281 times
File comment: File created with GDI+ build.
Invoice_GDI.zip [100.58 KiB]
Downloaded 284 times

_________________
Regards
Thomas Hoevel
PDFsharp Team
Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 28, 2009 1:08 pm 
Offline

Joined: Sun Jul 26, 2009 9:19 am
Posts: 4
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?


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 28, 2009 1:31 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 28, 2009 1:43 pm 
Offline

Joined: Sun Jul 26, 2009 9:19 am
Posts: 4
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 423 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