jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

-webkit-transform is not considered in doc.html

Open martineisele opened this issue 2 years ago • 1 comments

I have read and understood the contribution guidelines.

I tried to add rotation to a paragraph. It shows up correctly in HTML but once I print it as pdf it is not visible anymore.

Versions I am using:

  • jsPDF: 2.5.1
  • Chrome: 96.0.4664.93

Code snippets to reproduce the issue:

Paragraph which uses the style "textrotated"

<p class="textrotated">some text</p>

My CSS

.textrotated{
    margin-top: 250px;
    margin-left: 40px;
    float:left;
    color: #1b66b3;
    font-size: 40px;
    font-weight: bold;
    font-family: Helvetica, Arial, sans-serif;
    position: absolute;
    -webkit-transform: rotate(350deg);
    -webkit-backface-visibility: hidden;
    writing-mode: lr-tb;
}

Method to print pdf

printjspdf(){
    var doc = new jsPDF("p", "mm", "a4");

    doc.html(document.getElementById("page1"), {
       callback: function (doc) {
         doc.save();
       },
    image: { type: 'png'},
    width: 210,
    windowWidth: 793
    });
}

Thanks in advance!!

martineisele avatar May 05 '22 16:05 martineisele

facing the same issue

nagarajpabbathi avatar Jun 23 '22 10:06 nagarajpabbathi

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

github-actions[bot] avatar Sep 22 '22 02:09 github-actions[bot]

Any updates/work around here? I'm facing the same issue

kiran-pillai avatar Nov 18 '22 13:11 kiran-pillai

2023 . Same issue

JoeKing7 avatar Aug 22 '23 20:08 JoeKing7

Same issue, also with transform. Here is a codesandbox that shows the issue: https://codesandbox.io/s/modest-yalow-8xq2xf?file=/src/index.mjs

ahocevar avatar Nov 16 '23 20:11 ahocevar