Closed AletisFirst closed 5 years ago
Thanks for the bug report. Can you please provide a minimal repro SVG?
This code based on svg.js v2.7. As an example. The rectangle will also disappear in Adobe Acrobat.
`
let draw = SVG('canvas')
let hatch = draw.pattern(4, 4, function (add) { add.rect(4, 4) .attr({'fill': '#ffffff'}); add.path('M-1,1 l2,-2 M0,4 l4,-4 M3,5 l2,-2') .attr({'stroke-width': .6, 'stroke': '#a5a5a5'}) });
let rect = draw.rect(50, 50).stroke('#000').fill(hatch) `
So the actual svg is:
<svg id="SvgjsSvg1006" width="100%" height="100%"
xmlns="http://www.w3.org/2000/svg" version="1.1"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svgjs="http://svgjs.com/svgjs">
<defs id="SvgjsDefs1007">
<pattern id="SvgjsPattern1008" x="0" y="0" width="4" height="4" patternUnits="userSpaceOnUse">
<rect id="SvgjsRect1009" width="4" height="4" fill="#ffffff"></rect>
<path id="SvgjsPath1010" d="M-1 1L1 -1M0 4L4 0M3 5L5 3 " stroke="#a5a5a5" stroke-width="0.6"></path>
</pattern>
</defs>
<rect id="SvgjsRect1011" width="50" height="50" stroke="#000000" fill="url(#SvgjsPattern1008)"></rect>
</svg>
I cannot reproduce the bug. For me it renders fine both in Chrome as well as Adobe Acrobat Reader. Which version of svg2pdf, jsPDF and Acrobat are you using?
svg2pdf - v.1.3.4, jsPDF - v.2.0.2 Arcobat Pro - v.11.0.23.22 (Мас)
Please correct me if I'm wrong but it seems that your Acrobat version is quite outdated. Could you test your pdf on a more recent version?
Could you also try and open this file, which I created from the above SVG: pattern.pdf
Sorry for taking you time, the error is caused by the following code: pdf.output('datauri') pdf.save('file.pdf');
Browser's Print Preview:
Adobe Acrobat, Adobe Acrobat Pro: