Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag <a>, not working #368

Closed
KaiqueCovo opened this issue Oct 6, 2019 · 1 comment

Comments

@KaiqueCovo
Copy link

commented Oct 6, 2019

Hi Guys, help-me, tag it's not worked in my pdf

My code

$html = '<html>
      <head>
          <style>
              body {
                  margin: 0;
                  padding: 0;
              }
          </style>
          <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Bree+Serif:regular" id="font-full-590" crossorigin="anonymous" class="google-fonts">
          <meta charset="UTF-8" />
      </head>
      <body>
          <div style="display: block; background-color: #fff; width: 210mm; height: 297.2mm; overflow: hidden; position: relative;">
            <div style="position: absolute; word-break: break-word; color: rgb(102, 102, 102); width: 450px; height: 56.25px; text-shadow: rgb(0, 0, 0) 0px 0px 0px; font-size: 31.5px; opacity: 1; line-height: 31.5px; z-index: 1; transform: rotate(0deg); left: 148.5px; top: 33.75px;">
                <div>
                <span style="font-size: 78.75px; font-family: Bree Serif">MEU PEIXE</span>
              </div>
            </div>
            <div style="position: absolute; background-color: rgb(0, 0, 0); width: 726.75px; height: 603px; opacity: 1; z-index: 2; transform: rotate(0deg); left: 45px; top: 130.5px;">
            </div>
            <a href="https://www.google.com/" target="_blank">
              <img src="https://media.gettyimages.com/photos/closeup-of-fish-over-white-background-picture-id931270318?s=612x612" style="position: absolute; width: 589.5px; height: 401.062px; opacity: 1; z-index: 3; transform: rotate(0deg); left: 117px; top: 218.25px;">
            </a>
          </div>
      </body>  
      </html>';

      $snappy = new Pdf('/usr/local/bin/wkhtmltopdf');
      $snappy->generateFromHtml($html, BASE_PATH."/public/uploads/pdfs/myPdf.pdf");```
@KaiqueCovo

This comment has been minimized.

Copy link
Author

commented Oct 7, 2019

Hi guys, i solved the problem creating the elements separated and setting css for tag a

$html = '<html>

<head>
    <style>
        body {
            margin: 0;
            padding: 0;
        }
    </style>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Bree+Serif:regular" id="font-full-590" crossorigin="anonymous" class="google-fonts">
    <meta charset="UTF-8" />
</head>

<body>
    <div style="display: block; background-color: #fff; width: 210mm; height: 297.2mm; overflow: hidden; position: relative;">
        <div style="position: absolute; word-break: break-word; color: rgb(102, 102, 102); width: 450px; height: 56.25px; text-shadow: rgb(0, 0, 0) 0px 0px 0px; font-size: 31.5px; opacity: 1; line-height: 31.5px; z-index: 1; transform: rotate(0deg); left: 148.5px; top: 33.75px;">
            <div>
                <span style="font-size: 78.75px; font-family: Bree Serif">MEU PEIXE</span>
            </div>
        </div>
        <div style="position: absolute; background-color: rgb(0, 0, 0); width: 726.75px; height: 603px; opacity: 1; z-index: 2; transform: rotate(0deg); left: 45px; top: 130.5px;">
        </div>
        <a href="https://www.google.com/" target="_blank" style="position: absolute; width: 589.5px; height: 401.062px; left: 117px; top: 218.25px;">
        </a>
        <img src="https://media.gettyimages.com/photos/closeup-of-fish-over-white-background-picture-id931270318?s=612x612" style="position: absolute; width: 589.5px; height: 401.062px; opacity: 1; z-index: 3; transform: rotate(0deg); left: 117px; top: 218.25px;">
    </div>
</body>

</html>';

      $snappy = new Pdf('/usr/local/bin/wkhtmltopdf');
      $snappy->generateFromHtml($html, BASE_PATH."/public/uploads/pdfs/myPdf.pdf");
@alexpozzi alexpozzi closed this Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.