SVG-to-PDFKit icon indicating copy to clipboard operation
SVG-to-PDFKit copied to clipboard

Shadow, text Underline and text Opacity Issue when Export Fabric Canvas as PDF.

Open sagarvibrant opened this issue 5 years ago • 4 comments

I am using fabric js and Shadow, text Underline and text Opacity Not display in generated pdf file.

sagarvibrant avatar Nov 03 '19 12:11 sagarvibrant

Shadows are not implemented. Text underline and text opacity should display, so it is probably a bug. Can you attach a sample svg?

alafr avatar Nov 24 '19 11:11 alafr

Shadows are not implemented. Text underline and text opacity should display, so it is probably a bug. Can you attach a sample svg?

I have the same problems with opacity and underline.

this is my random example: https://jsfiddle.net/GranGabrio/xdu624wp/1/

GranGabrio avatar Mar 30 '20 14:03 GranGabrio

+1 😭

KKzLEO avatar Nov 23 '22 13:11 KKzLEO

it seems like the tspan element didn't receive the style from its parent text, so if you just set opacity on the text, it won't work.

if your svg structure is like below, it won't work fine with opcacity and underline.

<text xml:space="preserve" font-family="Crimson Text" font-size="39.82875000000001" font-style="normal" font-weight="bold" style="stroke: none;stroke-width: 1;stroke-dasharray: none;stroke-linecap: butt;stroke-dashoffset: 0;stroke-linejoin: miter;stroke-miterlimit: 4;fill: rgb(0,0,0);fill-rule: nonzero;white-space: pre;" opacity: 0.32179899999999995">
    <tspan x="-52.37" y="12.51" style="&#10;    >thujgf</tspan>
</text>

KKzLEO avatar Nov 23 '22 14:11 KKzLEO