PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Nov 01, 2024 12:13 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Feb 08, 2011 12:14 am 
Offline

Joined: Mon Feb 07, 2011 11:52 pm
Posts: 3
Hello!
I'm trying to draw an image on pdf page (bitmap, which is created through rendering wpf visuals (Geometries) with RenderTargetBitmap.Render). Bitmap has a huge resolution (3000*4000 or something like that). But in pdf strange gray shadows (lines) appear around my shapes and in general the image looks worse than bitmap original. I'm saving bitmap as png/jpg file before rendering it to pdf page, so I can show you the difference (attached screenshots, look at that weird gray vertical line). It seems that the pixels are not snapped in pdf or maybe it's because the pdf engine converts bitmap with huge losses before saving it in pdfpage ... I would just like to know the reason of this behaviour and possible workarounds on it.

Assembly: PdfSharp-WPF.dll (v1.31.1789.0, but also tried with v1.30).
Thank you in advance, sorry for my english)


Attachments:
pdf.png
pdf.png [ 71.87 KiB | Viewed 9610 times ]
image.png
image.png [ 45.18 KiB | Viewed 9610 times ]
code.png
code.png [ 8.28 KiB | Viewed 9610 times ]
Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 08, 2011 2:04 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3111
Location: Cologne, Germany
Hi!

I hope this post helps:
viewtopic.php?p=2471#p2471

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 10, 2011 9:38 am 
Offline

Joined: Mon Feb 07, 2011 11:52 pm
Posts: 3
Thanks for quick answer, but unfortunately it didn't help. Still there are strange dark-gray contour lines after saving to pdf.


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 10, 2011 9:45 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3111
Location: Cologne, Germany
fullwipe wrote:
but unfortunately it didn't help

What did you try?

Did you turn smoothing off in the display options of the Adobe Reader?

PDFsharp imports images unmodified into PDF files.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 10, 2011 1:55 pm 
Offline

Joined: Mon Feb 07, 2011 11:52 pm
Posts: 3
I've tried to set
ximage.Interpolate = false;
before
gfx.DrawImage(ximage, contentRect);

Now I tried to turn off all smoothing options in Adobe Reader, but nothing changed.
Can it happen because of the image dpi or drawing image scaled to contentRect?
Image dpi is pretty high (288), but adobe reader dpi is 110.


Attachments:
screen.png
screen.png [ 53.38 KiB | Viewed 9587 times ]
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 79 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