Svg contains image tag

Product: Windows PDF library

Product Version:
com.pdftron
PDFNet
10.6.0

Please give a brief summary of your issue:
Convert.officeToPdf → Using a docx template , creating pdf
Issue: if svg contains image tag then svg file is not adding to pdf

Template : {{image_url}} here imageUrl is svg local file path

sample svg file:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" baseprofile="tiny" x="0px" y="0px" viewbox="0 0 500 500" overflow="visible" xml:space="preserve"> 
   <g id="レイヤー_3"> 
    **<image width="1943" height="2296" xlink:href="data:image/png;base64," transform="matrix(0.2301 0 0 0.2301 50 50)"/>** 
   </g> 
   <g id="illust"> 
   </g> 
   <g id="number"> 
   </g> 
  </svg>

output : blank pdf is coming

1 Like

Thank you for contacting us about this. Can you please provide us with a sample image with the full image data for testing on our end?

Thank you.

1 Like

Sample data:

working image → Image1 .svg
Image1

Not working → Image2.svg
Image2

After Attaching image, your website is removing image tag, so refer below link to download svg
https://svgshare.com/getbyhash/sha1-PTJTkWpzHWz28Zwmw83DCKY0T9Y=

can SVG support in Pdf generation , Using a docx template - imageUrl?

1 Like

We are facing similar issue. Any update on this ?

1 Like

Thank you for the file. I have forwarded this to the team for further investigation and will get back to you when I have more info.

1 Like

@shakthi124 Please provide the update or ETA

1 Like

Just a quick update on this. The team has marked this issue as to be worked on in the next sprint or two (next 4-6 weeks). I will update you once I know more.

1 Like

Hello everyone, this issue has now been resolved in the latest nightly build available here which is ready for production usage. Please let me know if this works for you and if you have any further questions.

1 Like

Hi @shakthi124 , Facing same issue even after using 10.8.0 version.

Example document:
PdfTemplate.docx (19.2 KB)

Below json used for OfficeTemplateToPDF.

{
  "image": {
    "height": 500,
    "width": 500,
    "image_url": "WithImageTag.svg"
  }
}

Example Image which is not working:
https://svgshare.com/i/14n5.svg

Working image:
https://svgshare.com/i/14mk.svg

2 Likes

Any update on this ?

1 Like

Any update on this ?

1 Like

Hello, thank you for your patience. Can you please confirm that you are using 10.8 from the nightly builds (for example by downloading the appropriate build from the link here)?

When using the below JSON, I was able to produce the below output with the two images:
PdfTemplate.docx-test1.pdf (443.8 KB)

{
  "imageOne": {
    "height": 500,
    "width": 500,
    "image_url": "./14mk.svg"
  },
  "imageTwo": {
    "height": 500,
    "width": 500,
    "image_url": "./14n5.svg"
  }
}
1 Like

Hi @shakthi124 , I am using 10.8.0 as maven dependency

       <dependency>
			<groupId>com.pdftron</groupId>
			<artifactId>PDFNet</artifactId>
			<version>10.8.0</version>
		</dependency>

When i use nightly build jar with 10.8 version, its working perfect, but its not working for the maven dependency.

Nightly build output:
output.pdf (419.1 KB)
Its working fine with nightly build jar

maven build output:
output.pdf (409.4 KB)
Image is missing in the maven build
Image: https://svgshare.com/i/14n5.svg

is there any discrepancy present between above two jar?

Please verify once and looking forward for your response.

1 Like

Hello, thank you for confirming. The Maven version of the SDK is only updated alongside official releases. You can use the provided Jar in the nightly build, or wait for about 6 weeks for the next major release.

To get notified for the next official SDK release you can join our Discourse Announcements channel.

For platform specific notifications, such as Nuget, NPM, CocoaPods, please see the respective Apryse product documentation page.

1 Like