PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Jan 27, 2020 10:25 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Convert RGB PDF to CMYK
PostPosted: Fri Jan 03, 2020 3:37 pm 
Offline

Joined: Fri Jan 03, 2020 3:19 pm
Posts: 1
Hello,

I would like to know if there is a possibility to convert a PDF that is RGB into one with CMYK using PDFSharp in C#.
I'm already using PDFSharp for setting trim margins and the above mentioned functionality would save alot of time.

I've already tried something like this, but the new PDF is still in RGB

Code:
PdfDocument pdftest = PdfReader.Open(filename, PdfDocumentOpenMode.Import);
pdftest.Options.ColorMode = PdfColorMode.Cmyk;
PdfDocument oPDFNew = new PdfDocument();
PdfPage page1 = pdftest.Pages[0];
oPDFNew.AddPage(page1);
oPDFNew.Options.ColorMode = PdfColorMode.Cmyk;
oPDFNew.Save(filename2);


Thanks for your help


Top
 Profile  
Reply with quote  
PostPosted: Sat Jan 04, 2020 1:13 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 517
Location: CCAA
Hi!
kernig wrote:
pdftest.Options.ColorMode = PdfColorMode.Cmyk;
This applies to new content you add to pages using XGraphics objects.

PDFsharp does not convert existing pages to the other format.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


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

All times are UTC


Who is online

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