For example, I have the following CSS, called foobar.css:
The javascript file, called foobar.js is:
And in HTML, called foobar.html I add them both:
When I add the file foobar.html to the PrinceGUI and click on the convert button, I see in the PDF output "Generated content from Javascript!" in the bottom of the page foobar.
When I do the same with the PrinceXML command line on windows 7 x64 (prince.exe is located in the PATH),
"prince foobar.html -o foobar.pdf"
I see the same, the DOM structure and CSS-stylesheet are applied in the foobar.pdf. But the generated Javascript "Generated content from Javascript!" is missing in the foobar.pdf.
When I add the SAME file foobar.html to the PrinceGUI and convert it, the text from Javascript will appear. But is missing when I do the same on the command line.
@page foobar{
@bottom-right {
content: prince-script(myfunc)
}
}
The javascript file, called foobar.js is:
function myfunc() {
return "Generated content from Javascript!";
}
Prince.addScriptFunc("myfunc", myfunc);
And in HTML, called foobar.html I add them both:
<html>
<head>
<link rel="stylesheet" type="text/css" href="foobar.css">
<script src="foobar.js"></script>
</head>
<body>
[..]
When I add the file foobar.html to the PrinceGUI and click on the convert button, I see in the PDF output "Generated content from Javascript!" in the bottom of the page foobar.
When I do the same with the PrinceXML command line on windows 7 x64 (prince.exe is located in the PATH),
"prince foobar.html -o foobar.pdf"
I see the same, the DOM structure and CSS-stylesheet are applied in the foobar.pdf. But the generated Javascript "Generated content from Javascript!" is missing in the foobar.pdf.
When I add the SAME file foobar.html to the PrinceGUI and convert it, the text from Javascript will appear. But is missing when I do the same on the command line.
Edited by Ehart