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.

Tue Nov 22, 2016 9:51 pm

Is it possible to draw vector graphic line on pdf? is it possible by using any of spire libraries?
thanks

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

Wed Nov 23, 2016 2:14 am

Dear spirepap,

Thanks for posting.
What is the format of the vector graphic ?
Please provide us sample vector graphic and the result document you want to help us investigate further. And then we will update to you.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Wed Nov 23, 2016 5:52 pm

I have a pdf, have to draw a line on pdf.
Last edited by spirepap on Thu Apr 13, 2017 10:06 pm, edited 1 time in total.

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

Thu Nov 24, 2016 6:26 am

Dear spirepap,

Thanks for the information.
Sorry that at present Spire.PDF doesn't support to add a line with CMYK color into a layer. But we have added the feature into our schedule, once there is any progress, we will inform you.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Thu Dec 08, 2016 11:18 pm

it is not necessarily be in a layer....
Last edited by spirepap on Thu Apr 13, 2017 10:05 pm, edited 1 time in total.

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

Fri Dec 09, 2016 2:18 am

Dear spirepap,

Thanks for your information.
The new feature we added is to support CMYK color, if it is done, you can draw things(not only include layer) with CMYK color, and then your requirement will be met. We will inform you as soon as it is done.

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:36 am

Dear spirepap,

Thanks for your waiting.
We just release the Spire.PDF Pack(Hot Fix) Version:3.8.152, which includes the 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:26 pm

thank you so much, it worked fine.

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

Wed Jan 18, 2017 1:33 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

Wed Jan 18, 2017 6:09 pm

Thank you!!
Last edited by spirepap on Thu Apr 13, 2017 10:07 pm, edited 2 times in total.

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

Thu Jan 19, 2017 4:04 am

Dear spirepap,

Thanks for your information.
I have noticed the line issue and posted it to our Dev team. Once there is any news, we will inform you.
And for the line, like the code you just provided, the generated pdf is vector format by default.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Thu Jan 19, 2017 5:20 pm

I see some difference in quality between the following two cases

Code: Select all
barcode1.Draw(page, new PointF(0, y));
PdfImage img = barcode1.ToImage();
//draw this image on pdf
Last edited by spirepap on Thu Apr 13, 2017 10:09 pm, edited 1 time in total.

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

Fri Jan 20, 2017 3:10 am

Dear spirepap,

Thanks for your feedback.
Sorry that at present the first case cannot set the barcode width, but you can set the height by method barcode1.BarHeight. And I have posted the issue to our Dev team, when it can set the size I will inform you soon.
As a temporary solution, you can use the second case you mentioned, resize the barcode Image and then draw it on PDF.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Mon Feb 06, 2017 8:53 am

Dear spirepap,

Thanks for waiting.
Now the issue using spot color to draw line has been resolved in Spire.PDF Pack(Hot Fix) Version:3.8.173. Welcome to test it.
Looking forward to your reply.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Mon Feb 13, 2017 6:33 am

Dear spirepap,

Did you test the hotfix ? Has the drawing line issue been resolved ?

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Return to Spire.PDF