- This topic has 3 replies, 2 voices, and was last updated Dec 06, 2011
16:22:10 by PD4ML.
November 29, 2011 at 18:33#26633
Hopefully this is the correct forum for my question…if not, feel free to move this post.
I’m currently evaluating multiple products to transform HTML files into PDF files. The current software we use is no longer supported so we have to find a replacement. So far, I have been able to replicate everything we do currently using PD4ML except for one issue.
Basically, in our current HTML that gets converted to PDF, the images and CSS sheets are referenced like the following:
And then in our current software, we define a ‘base’ directory to use for all of these input type files. Notice the ‘/’ at the beginning of the path about. I know this is not standard but our current software is smart enough to figure it out and the files are imported into the conversion process just fine.
One of the other software packages I have written a demo with did not handle this the way we would want but they have a specific method where you can add an XSL file to run first on the inputed HTML file before the conversion to PDF. So…I have a simple XSL file that strips the leading ‘/’ off of paths from ‘src’ and ‘href’ tags and then the conversion works fine.
Is there something equivalent for PD4ML? I know I could do the XSL translation in code first before calling PD4ML but just wanted to make sure I was not missing something when I present my findings from the evaluation.
Our clients have hundereds of HTML files that get converted to PDF on a daily basis and would rather not have to manually update all of them to remove the starting slash.
Thanks.December 6, 2011 at 16:02#28721
Is in the path /userdata is a web application name or just a legacy path, which currently makes no special sense?December 6, 2011 at 16:08#28722
Yes…its just a path. But as I tried to explain in my post, it really should be:
without the starting ‘slash’. But as our current software handles this just fine, it was only an issue when I started to look for a replacement. Another product allows a use of an XSL tranformer to be applied before the conversion of HTML to PDF and I was wondering if PD4ML had something similar. If not, I figure I have 2 choices…either do the XSL transformer before calling PD4ML or have the client manually update their hundreds of HTML files. Just wanted to make sure I did not miss any functionality of PD4ML. Thanks.December 6, 2011 at 16:22#28723
For web scenarios PD4ML JSP taglib offers a tag to pre-process such type of paths, however it makes nothing special: it looks for a given pattern (for example, “”/userdata/includes”) and substitutes it with a desired string (“”userdata/includes”) . It works with the source HTML document as with a single string, ignoring the document structure – you could always implement your own similar solution.
But I would recommend you to create a simple custom resource loader:
and to interpret the “non-standard” paths the way you like.
The forum ‘General questions / FAQ’ is closed to new topics and replies.