Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Dec 08, 2016 11:10 pm

how to create PdfPath with CMYK colorspace?

spirepap
 
Posts: 17
Joined: Thu May 12, 2016 5:07 pm

Fri Dec 09, 2016 2:24 am

Dear spirepap,

Thanks for your inquiry.
Sorry that Spire.PDF doesn't support CMYK colorspace at present, and we have added the new feature into our schedule. We will infrom you as soon as it is done.
Sorry for inconvenience caused.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Jan 17, 2017 7:40 am

Dear spirepap,

Thanks for your waiting.
We just release the Spire.PDF Pack(Hot Fix) Version:3.8.152, which includes that new feature. Welcome to test it.
Here is sample code for your reference.
Code: Select all
                PdfDocument pdf = new PdfDocument();
                PdfPageBase page = pdf.Pages.Add();
                PdfSeparationColorSpace cs = new PdfSeparationColorSpace("MySpotColor", Color.Red);
                //Light
                PdfSeparationColor color = new PdfSeparationColor(cs, 0.1f);
                PdfSolidBrush brush = new PdfSolidBrush(color);
                page.Canvas.DrawString("Test light", new PdfFont(PdfFontFamily.Helvetica, 13f), brush, PointF.Empty);
                //Medium
                color = new PdfSeparationColor(cs, 0.5f);
                brush = new PdfSolidBrush(color);
                page.Canvas.DrawString("Test medium", new PdfFont(PdfFontFamily.Helvetica, 13f), brush, new PointF(0, 20));
                //Darkest
                color = new PdfSeparationColor(cs, 1);
                brush = new PdfSolidBrush(color);
                page.Canvas.DrawString("Test darkest", new PdfFont(PdfFontFamily.Helvetica, 13f), brush, new PointF(0, 40));
                pdf.SaveToFile("SpotColor.pdf");

If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Jan 17, 2017 11:25 pm

Thank you so much for the support, it worked fine.

spirepap
 
Posts: 17
Joined: Thu May 12, 2016 5:07 pm

Wed Jan 18, 2017 1:39 am

Dear spirepap,

Thanks for your feedback.
Sorry that I forgot to tell you that the code I provided is to create spot color. According your description, you want the path name and CMYK, but there is no that name statement for path in PDF, we suppose you want spot color which may meet your requirement.
And there is code about CMYK for your reference.
Code: Select all
            PdfDocument pdfdoc = new PdfDocument();
            PdfPageBase page = pdfdoc.Pages.Add();
            pdfdoc.ColorSpace = PdfColorSpace.CMYK;
            PdfSolidBrush brush = new PdfSolidBrush(new PdfRGBColor(0, 0.5f, 0.25f, 0));
            page.Canvas.DrawLine(new PdfPen(brush), new PointF(100, 100), new PointF(300, 100));
            pdfdoc.SaveToFile("SetCMYKColor.pdf", FileFormat.PDF);

If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF

cron