PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jul 14, 2024 8:08 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Mar 27, 2014 3:02 pm 
Offline

Joined: Thu Mar 27, 2014 6:30 am
Posts: 5
I'm trying to set the colour of a paragraph to a specific colour, but the produced PDF is a lot darker.

In the attachment the "ran" is the darker colour being produced and the "Are Ba" is the colour I want.
I have tired:
Code:
//style.Font.Color = Color.FromCmyk(1,0,0.545,0.310);// - is white / transparent
//style.Font.Color = Color.Parse("0x00B050");//too dark
style.Font.Color = new Color(0, 176, 80);//too dark

and both produce the same darker colour.

Is there a limit to the colors that can be used?


Attachments:
colorIssue.JPG
colorIssue.JPG [ 42.24 KiB | Viewed 3825 times ]
Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 27, 2014 3:21 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi!
You specify "(0, 176, 80)", PDFsharp writes "(0, 176, 80)" into the PDF file. Color profiles may be accountable for the visual difference, but that is not my area of experience.

BTW: Try Color.FromCmyk(100,0,54.5,31) instead (value range 0 through 100).

BTW2: Are you creating a CMYK PDF file? I tried the color "(0, 176, 80)" in an RGB PDF and I got the bright green (left part of image).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 27, 2014 7:02 pm 
Offline

Joined: Thu Mar 27, 2014 6:30 am
Posts: 5
fantastic, I had

document.UseCmykColor = true

right at the top of my code.

Removed it and all is good with the world again


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

All times are UTC


Who is online

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