HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › HTML/CSS rendering issues › PDF not able to use relative paths
- This topic has 2 replies, 1 voice, and was last updated Apr 14, 2017
15:03:24 by Anonymous.
-
AuthorPosts
-
April 12, 2017 at 18:52#27141
I am facing this issue, where i have a servlet to which i pass html content and try to convert it in PDF, content of page gets converted into PDF, but while rendering page is not using any CSS files, to debug i enabled debug mode and i get
csstest.css (The system cannot find the path specified): file:css/test.css (socket timeout 0ms)
After looking at forums, i came across useServletContext and useHttpRequest, tried using both, still same issue.
Below are the complete logs.
version: PD4ML 3101 Pro DMS
loading CSS file for file:css/test1.css
not yet in cache: file:css/test1.css
loading file:css/test1.css [1ms]
csstest1.css (The system cannot find the path specified): file:css/test1.css (socket timeout 0ms)
can not read file:css/test1.css
loading CSS file for file:css/test2.css
not yet in cache: file:css/test2.css
loading file:css/test2.css [0ms]
csstest2.css (The system cannot find the path specified): file:css/test2.css (socket timeout 0ms)
can not read file:css/test2.css
loading CSS file for file:css/test3.css
not yet in cache: file:css/test3.css
loading file:css/test3.css [0ms]
csstest3.css (The system cannot find the path specified): file:css/test3.css (socket timeout 0ms)
can not read file:css/test3.css
loading CSS file for file:css/test4.css
not yet in cache: file:css/test4.css
loading file:css/test4.css [1ms]
csstest4.css (The system cannot find the path specified): file:css/test4.css (socket timeout 0ms)
can not read file:css/test4.css
image not yet in cache: file:images/pCaller.png
not yet in cache: file:images/pCaller.png
loading file:images/pCaller.png [0ms]
imagespCaller.png (The system cannot find the path specified): file:images/pCaller.png (socket timeout 0ms)
image file:images/pCaller.png has zero length.
can not load image: images/pCaller.png
done in 1001ms.
resulting PDF size: 32157 bytesApril 14, 2017 at 13:41#30024Fixed above issue, but i am stuck on another one, another something i read in multiple threads, but not sure whether its supported or not, i have an HTML which has a main header, and then table header i want to repeat both of them on page breaks, below is what i am trying to do.
Header 1 Table Header Table Header Table Header Table Header Table Header Table Header Table Header 26
My Content27
My Content28
My Content1
My Content2
My Content3
My Content4
My Contentin above example i know that pd4ml doesn’t supports thead, what i am doing is breaking the html on the basis of thead, tbody and tfooter, and using it to set below api’s
pd4ml.setPageHeader
pd4ml.render
pd4ml.setPageFooterWhat happens is, it only displays Header 1, Table header’s are never displayed, if i remove Header 1, Table Header’s are displayed, but i want both of them to be displayed in each page.
April 14, 2017 at 15:03#30025Never mind fixed above as well, posting it for someone who is faces same issues
1. css not getting rendered :- in my cases i had to add an extra / before css path, it started taking relative path.
2. header getting cut off :- i had to use pd4PageMark.setAreaHeight, this fixed issue for me.my next step is to move whole thing from servlet to rest service, lets see how it goes.
-
AuthorPosts
The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.