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.

Wed Feb 26, 2020 11:35 am

Hi all,

We have a lot of svg file which used to put in PDF content & header. Basically we use HTML for page content but for header, footer, we had to draw by ourselves.
I just bought Spire.PDF and I want to ask how to display an SVG file in PDF Header / Footer?

Thank you,

hecWorkwear
 
Posts: 11
Joined: Wed Feb 26, 2020 7:17 am

Thu Feb 27, 2020 6:03 am

Hello,

Thanks for your inquiry.
Sorry to tell that at present our Spire.PDF doesn't support adding svg files to PDF documents. We have added this feature into our further upgrade list with the ticket SPIREPDF-1258. If there is any update, we will let you know.
Apologize for the inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Thu Mar 05, 2020 2:20 am

Thank you Rachel, we use SVG for vector output and high quality printing. Currently, SVG can be load with HTML conversion, but only header meet this issue because header made by drawing.

Please let me know if any update :).

hecWorkwear
 
Posts: 11
Joined: Wed Feb 26, 2020 7:17 am

Thu Mar 05, 2020 9:04 am

Hello,

Thanks for your following up.
I got news from our Dev team that this new feature is very difficult and complicated. This may take a long time. Anyway, we have given your issue the highest priority.
Once there is any update, we will inform you ASAP. Sorry for the inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Tue Mar 10, 2020 8:30 am

Hello,

Hope you are doing well.
Now our Dev team is gradually developing this new feature of adding SVG to PDF. Could you please provide your SVG files with us? We’d like to ensure the feature can work for your SVG perfectly. You could upload here or send them to us(support@e-iceblue.com) via email.
Thanks for your assistance in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Wed Mar 18, 2020 11:05 am

Hi Rachel,

Thank you for your response. Please find svg file in attachment.

hecWorkwear
 
Posts: 11
Joined: Wed Feb 26, 2020 7:17 am

Thu Mar 19, 2020 2:04 am

Hello,

Thanks for your providing.
I will inform you immediately when new version which supports the feature is released.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Tue May 12, 2020 10:50 am

Hello,

Thanks for your patient waiting.
Glad to tell you that we just released Spire.PDF Pack(Hot Fix) Version:6.5.6 which supports adding SVG picture to PDF. Welcome to download it from the following link.
https://www.e-iceblue.com/Download/down ... t-now.html

Example:
Code: Select all
    PdfDocument doc1 = new PdfDocument();
    doc1.LoadFromSvg("logo.svg");
    PdfDocument doc2 = new PdfDocument();
    doc2.LoadFromFile("input.pdf");
    doc2.Pages[0].Canvas.DrawTemplate(doc1.Pages[0].CreateTemplate(), new PointF(10, 10), new SizeF(60, 60));
    doc2.SaveToFile("out.pdf", FileFormat.PDF);


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon May 25, 2020 8:24 am

Hello,

Hope you are doing well.
Have you tested this new feature? Looking forward to you further feedback.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Wed May 19, 2021 10:03 am

Hello,

I like this feature a lot.

But is it possible to add another overload to the PdfDocument.LoadFromSvg method? One that accepts a Stream or a byte[] or a string (svg markup). Or perhaps a LoadFromStream overload that accepts a FileFormat parameter.

We have SVG's stored as strings in our database of a web application. To use them in a dynamically generated *.pdf file, we would have to
- retrieve them from the database
- write them to a temporary file
- load them using PdfDocument.LoadFromSvg()
- remove temporary file

this would cause a lot of disk activity we would rather avoid.

Best regards

pietdeboer
 
Posts: 2
Joined: Wed May 19, 2021 9:55 am

Thu May 20, 2021 2:36 am

Hi,

Thanks for your inquiry.
We will add an overload to accept a stream in LoadFromSvg method. Once it is achieved in the future, we will let you know.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Fri Jun 04, 2021 9:38 am

Hello,

Glad to inform you that we just released Spire.PDF Pack Version:7.6 which implements receiving SVG stream, please download it from the following links to test on your side.
Website link: https://www.e-iceblue.com/Download/download-pdf-for-net-now.html
Nuget link: https://www.nuget.org/packages/Spire.PDF/7.6.0
Code: Select all
doc.LoadFromSvg(Stream stream);

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Tue Jun 08, 2021 10:52 am

Hello Annika,

Thank you very much for the quick response.

Best regards

pietdeboer
 
Posts: 2
Joined: Wed May 19, 2021 9:55 am

Wed Jun 09, 2021 5:38 am

Hello,

You are welcome.
If you have other questions about using Spire.PDF in the future, please feel free to contact us.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF