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

Borders hidden #95

Closed
MikeGsus opened this issue Mar 22, 2018 · 5 comments
Closed

Borders hidden #95

MikeGsus opened this issue Mar 22, 2018 · 5 comments

Comments

@MikeGsus
Copy link

Hi, I'm exporting a HTML Table and some inputs to PDF, but when it renders don't shows the borders of the elements. It looks like this:
captura de pantalla 25

When the HTML looks:
screenshot-2018-3-22 intrainingls

I just want to display the element's borders in the PDF as the HTML.

@MikeGsus
Copy link
Author

If is usefull to somebody, I just do wider the borders, so they appear at PDF.

@weixiongBirnary
Copy link

I have the same problem, can u tell me how to fix this

@DaddyWarbucks
Copy link

DaddyWarbucks commented Jul 12, 2021

I am also experiencing this issue. Some borders display properly, some do not. I cannot discern what makes the difference in them displaying or not. I have tried making the borders wider and darker, but that did not help. Thanks for any help!

Using version 0.9.3.

I removed any options, etc and tried to use the most simple code possible and am still experiencing the issue.

html2pdf()
    .from(target)
    .save()

@DaddyWarbucks
Copy link

After some further investigation, I now realize this is likely an issue with html2canvas and not html2pdf directly. The issue appears to be solved over in that library according to this: niklasvh/html2canvas#2010. And that makes sense because I am using "partial" borders as that issues outlines (via Bootstrap .border-bottom, .border-right, etc).

This library is still using "html2canvas": "^1.0.0-alpha.12" an alpha version of the 1.0 release. I suspect that updating to the latest production release of 1.1.1 would solve this issue.

Is there anything I can do to help make this happen?

@DaddyWarbucks
Copy link

DaddyWarbucks commented Jul 12, 2021

I have created a jsfiddle here: https://jsfiddle.net/0tk5mdax/26/. The fiddle is an exact copy of my HTML that I am trying to convert. And you can see it is rather complex as far as borders go.

It seems to work as expected. Which is good news!

But, I am still unable to get this working in my own application. I have even stripped everything out that I can think of, including custom Bootstrap code/themes, third party CSS, plugin/extension CSS, etc. So I am unclear why this works in isolation in the fiddle but not in "isolation" (as much as I can) in my own app. I have also tried Safari, Chrome, and FF but all seem to fail.

Oddly, when I manually add the library via the instructions here: https://github.com/eKoopmans/html2pdf.js#console and then call html2Pdf(myElem) it works as expected.

Sorry for the spam and any help is appreciated. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants