Is Javascript executed when pubilshing to PDF?
-
- Jr. Propeller Head
- Posts: 3
- Joined: Tue Feb 04, 2014 3:12 pm
Is Javascript executed when pubilshing to PDF?
Hi all,
We're considering the use of the Javascript package MathJax (http://www.mathjax.org/) for rendering equations in our documents. (In a nutshell: the Javascript parses MathML or LaTeX and replaces it with plain text, typesetting with CSS.)
Obviously, this requires that the Javascript be executed prior to the content being rendered as a PDF. When targeting HTML5 or Help File format, the equations look as expected (because the web browser is running the Javascript). However, when targeting PDF, the equations appear in their "pre-rendered" text (MathML or LaTeX).
What are the details of the process involved with publishing to a PDF? Is it possible for the process to execute Javascript hosted in the pages?
Regards,
Joe Miller
We're considering the use of the Javascript package MathJax (http://www.mathjax.org/) for rendering equations in our documents. (In a nutshell: the Javascript parses MathML or LaTeX and replaces it with plain text, typesetting with CSS.)
Obviously, this requires that the Javascript be executed prior to the content being rendered as a PDF. When targeting HTML5 or Help File format, the equations look as expected (because the web browser is running the Javascript). However, when targeting PDF, the equations appear in their "pre-rendered" text (MathML or LaTeX).
What are the details of the process involved with publishing to a PDF? Is it possible for the process to execute Javascript hosted in the pages?
Regards,
Joe Miller
Re: Is Javascript executed when pubilshing to PDF?
I am having the same problem. I wrote a small script to dynamically put in referenced line numbers from other cells in a table. It works perfect when publishing to HTML5, however, my end user requires the documents to be published as PDF. Is there a way to get the JavaScript to process prior to publishing the PDF?
thanks, mike
thanks, mike
Re: Is Javascript executed when pubilshing to PDF?
Lilshieste - Flare does already have an equation editor that supports MATHML and works for PDFs; or does that not meet your requirements?
See: http://webhelp.madcapsoftware.com/flare ... ations.htm
See: http://webhelp.madcapsoftware.com/flare ... ations.htm
-
- Jr. Propeller Head
- Posts: 3
- Joined: Thu Feb 27, 2014 3:20 am
Re: Is Javascript executed when pubilshing to PDF?
I'm also interested in implementing MathJax, but I'm very new to Flare. I'd be interested in any advice you have.
The integrated equation editor is OK, but our company style is white text on a charcoal background, and the resulting PNGs have a very chunky and pixelated look compared to regular text. Modifying the "MathType | Equation" styles for font weight and so forth doesn't seem to have any effect; the current result is at the border of legibility.
The integrated equation editor is OK, but our company style is white text on a charcoal background, and the resulting PNGs have a very chunky and pixelated look compared to regular text. Modifying the "MathType | Equation" styles for font weight and so forth doesn't seem to have any effect; the current result is at the border of legibility.
You do not have the required permissions to view the files attached to this post.
-
- Jr. Propeller Head
- Posts: 3
- Joined: Tue Feb 04, 2014 3:12 pm
Re: Is Javascript executed when pubilshing to PDF?
Hi Dave Lee,Dave Lee wrote:Lilshieste - Flare does already have an equation editor that supports MATHML and works for PDFs; or does that not meet your requirements?
See: http://webhelp.madcapsoftware.com/flare ... ations.htm
Thanks for the response, I apologize for not seeing it sooner (I mistakenly thought I had my preferences set up to send me email notifications for replies).
I'm indeed aware of Flare's built-in equation editor, but would actually like to render our equations in text whenever possible (i.e., instead of as images). As BenMathiesen mentioned, it's not uncommon for equations to appear "blocky" when rendered as images. (Additionally, this effect is exacerbated when a user attempts to "zoom" into a document to enlarge the text.)
This is why we've considered using MathJax, which uses JavaScript to parse MathML/LaTeX into a text-based representation. MathJax allows us to render our equations as expected in our HTML publications, but it isn't able to accommodate PDFs (or other non-web-based formats). So I was wondering if there might be some way to incorporate the MathJax processing into the generation of the PDF.
Alternatively, I would be open to the possibility of using MathJax for our HTML publications, and falling back on the PNG renderings for our PDFs. Unfortunately, I wasn't able to figure out a way of accomplishing this, since MathML is automatically wrapped in a MadCap:equation element (which effectively hides the markup from MathJax). This was actually the impetus for my other question: MathML without MadCap:equation?
Thanks for any help,
Joe
-
- Jr. Propeller Head
- Posts: 3
- Joined: Thu Feb 27, 2014 3:20 am
Re: Is Javascript executed when pubilshing to PDF?
Just a quick update on this issue:
In Flare 10 Madcap introduced anti-aliasing to the images generated by MathML, so they look much better. However, this assumes a light background and can't be turned off. So if your website uses dark text on a light background MathML should be fine for both web and PDF outputs.
For a dark background, the dev team accepted my bug report (#100312).
Cheers,
Ben
In Flare 10 Madcap introduced anti-aliasing to the images generated by MathML, so they look much better. However, this assumes a light background and can't be turned off. So if your website uses dark text on a light background MathML should be fine for both web and PDF outputs.
For a dark background, the dev team accepted my bug report (#100312).
Cheers,
Ben
Re: Is Javascript executed when pubilshing to PDF?
In response to the original post.
I have implemented a solution, in which I
The tool is for sale...
-Niels
I have implemented a solution, in which I
- Enter equations directly using LaTex, but enclosed in \( )\ for inline and \[ ]\ for paragraph equations - e.g. \( {A}_{delta} = {A}_{new} - {A}_{executed} \)
- For Web, MathJax typesets this online, on-the-fly (no wait at all).
- For PDF, my developer colleague has created a tool which
- Parses all content files
- Puts all equations into a Web Only condition
- Runs all equations through a LaTex compiler which generates .PS files
- Stores the .PS files in an "Equations" directory in the Images directory, including whichever subdir the eq was found in
- Inserts said .PS as images, enclosed in a Print Only condition
- Prints a list of what was done.
The tool is for sale...
-Niels
-----
Flaring in Copenhagen, Denmark
Flaring in Copenhagen, Denmark
Re: Is Javascript executed when pubilshing to PDF?
The PDFs I generated from Flare 10 have equations rendered as text. They do show as images in the help outputs, though (but as stated, with antialiasing which makes them look reasonably nice).
Re: Is Javascript executed when pubilshing to PDF?
OK, so you use text in PDF, and images in Web. I do the exact opposite...
-----
Flaring in Copenhagen, Denmark
Flaring in Copenhagen, Denmark
-
- Propeller Head
- Posts: 10
- Joined: Fri Jul 12, 2013 4:53 am
Re: Is Javascript executed when pubilshing to PDF?
Hi everybody,
I have just read this thread.
I have the same problem. We have LaTeX documents and we produce both print and online outputs.
I converted LaTeX to HTML and used Mathjax for my HTML5 output.
But for my print output, I still use LaTeX editor. My goal is to use only one source, so that I don't have to modify .tex and .html files ...
Regarding your workarounds, I assume that my feature request of importing LaTeX into Flare or handling LaTeX for print outputs has only a little chance to succeed then
Niels, how much for your tool ?
I have just read this thread.
I have the same problem. We have LaTeX documents and we produce both print and online outputs.
I converted LaTeX to HTML and used Mathjax for my HTML5 output.
But for my print output, I still use LaTeX editor. My goal is to use only one source, so that I don't have to modify .tex and .html files ...
Regarding your workarounds, I assume that my feature request of importing LaTeX into Flare or handling LaTeX for print outputs has only a little chance to succeed then
Niels, how much for your tool ?
Re: Is Javascript executed when pubilshing to PDF?
@Lilshieste: I'll talk to my boos and the developer, and get back to you!
-Niels
-Niels
-----
Flaring in Copenhagen, Denmark
Flaring in Copenhagen, Denmark