Closed immortalcy closed 8 years ago
Hi, which version are you using? Can you paste some example code?
Yes sorry.
Version: "it.innove" % "play2-pdf" % "1.4.0"
Examples Code:
<html>
<head>
<title>PDF Sample</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="@routes.Assets.public("pdf/main.css")">
<link rel="stylesheet" type="text/css" href="@routes.Assets.public("pdf/bootstrap/css/bootstrap.min.css")">
<link rel="stylesheet" type="text/css" href="@routes.Assets.public("pdf/bootstrap/css/bootstrap-theme.min.css")">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-12">
</div>
</div>
</div>
</body>
</html>
Hmmm, I dont know if it really matters but this code is based on the scala multiseed project from here.
I don't know the project, maybe the problem is the relative path of the css resources, can you try to use absolute path?
Yes but if that was the case wouldn't the page render have the same issue as well? I mean displayed without the styles?
I can't get your point, can you explain better? I don't know how the multidomain project handles the static resources. The HTML request is made outside the user session so maybe there are some problems in there.
And it is able to find all the images but not the .css? That is the most strange thing that happens.
The images are from the same routes? Try add this in your routes:
GET /pdf/*file controllers.Assets.at(path="/public/pdf", file)
Yes the images are exactly on the same location with main.css I will try it and let you know.
The .css file is included as well. I am not sure if its something we changed on the routes of the multipart project or not but now it works!!
Thanks for your time and help.
You're welcome
Hello and thanks for the great module.
I am trying to attach a .pdf file to an email by using
val pdf = pdfGenerator.toBytes(pdf.render(object), "http://localhost:9000/")
and it seems like the .css files are ignored; something that is not happening when I include an image to it (both included with@routes.Assets.public("file.ext")
).Generated .pdf contains all the images (as it should) but there is no style applies to it.
Maybe this might be related to this issue?