cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Arbortext Layout Developer (ALD): I would like to increase the quality of mathjax formula (SVG).

Arbortext Layout Developer (ALD): I would like to increase the quality of mathjax formula (SVG).

 

Arbortext Layout Developer (ALD): I would like to increase the quality of mathjax formula (SVG).

 

image1.jpg

 

For example, is it possible to improve quality in the following ways?

Improve the SVG image quality by increasing the scale of the formula and converting it into an image.

I was able to change the scale manually.

 

image2.jpg

 

I hope this can be achieved with the following javascript.

 

var mathObject = {};
mathObject.type = type;
mathObject.output = math_name;
mathObject.content = xpathString;
mathObject.scale="1500%";                                   /* I would like to add "scale" as a function addition. */

content.functions.mathjax.createGraphic(mathObject);

13 Comments
GarethOakes
16-Pearl

I understand what you mean but SVG is a vector format, it doesn't have a resolution. The display size will be based on how you are outputting the maths equation. The display quality will be based on whatever is rendering the SVG, for PDF output the SVG should be turned into true curves etc. I think APP/ALD has long had the option to handle SVG images this way (instead of rasterization).

myamaguchi-2
3-Visitor

Use "Acrobat Printer" to create high quality PDF.
If you convert this PDF to SVG with Illustrator, you can create high-quality SVG.

Can you do the same thing as this?

 

 

GarethOakes
16-Pearl

Yes that's what I mean, if you have SVG in an APP document and print direct to PDF (not via PostScript) then you should get nice sharp outlines no matter the zoom level in the PDF.

myamaguchi-2
3-Visitor

I tried a direct PDF output but was not improved.

 

d.jpg

b.jpg

GarethOakes
16-Pearl

OK I see what you mean now, the curve accuracy is not good. That is because you are using the old SVG importer for APP. I seem to remember that there is a way to increase the curve accuracy but it will still draw curves using many straight lines instead of clean curves.

I don't know how to attach files but I created two samples that show the difference using APP old vs new SVG methods. The new method provides much better results as it uses the built-in SVG support of PDFlib. svg-test1 is old method, svg-test2 is new method. Download link: https://app.box.com/s/d8hsiwc9qu6r4fzimkpb0uhkvyx9ly5d

I don't know how to implement this for math equations, but in my sample I simply had to load the SVG as fGraphic.FT_SVGPASSTHRU (type 7), this is what causes APP to handover the SVG direct to PDFlib. I was even able to achieve this by editing my .3D file to force type 7. There is a PDF driver setting that I also changed: "Linked Images" to "Passthrough" (not certain this is necessary).

dialog.pngfile.png

myamaguchi-2
3-Visitor

Thank you for the sample.


> I don't know how to implement this for math equations.


I want to know this.
And in the case of FT_SVGPASSTHRU (type 7), I think that the preview could not be displayed correctly on the 3d file, so I would like it to be able to display it.


However.


The best solution is to renew the old SVG importer and cope with the next upgrade.


--------------------------------
Another matter.

Unfortunately, the sample was not displayed correctly in ALD Ver.12.
There was no problem with APP11.2 M040.

ALD Ver.12
ALD_Ver12.jpg


APP11.2 M040
APP_Ver11_2.jpg

GarethOakes
16-Pearl

I prepared the samples in APP 11 as I haven't got around to installing ALD 12 yet. Therefore I don't have MathJax available for equations testing. You could try re-creating my sample in ALD 12 to see if there is a bug or not (you should report bugs to PTC).

I very highly doubt the old SVG importer will have any further work done. On my machine the type 7 new SVG mode will preview on-screen and print correctly to PDF.

myamaguchi-2
3-Visitor

I hope it will be improved in any way.
If you like, please give me a vote.

GarethOakes
16-Pearl

I agree that the default configuration of ALD 12 should give best possible output fidelity for equations, so you get my vote!

SimonTaylor
11-Garnet

Hi

12.1.0.0 now provides a 'scale' option to scale the graphics, amongst other improvements to the MathJax object which is used to create the SVG. We are investigating two things currently - one is how to simply pass the SVG directly to the PDF engine and the other is how to support Bezier curves in our SVG support.

Hope this helps

Simon

SimonTaylor
11-Garnet
Status changed to: Implementation In Progress
 
SimonTaylor
11-Garnet
Status changed to: Under Consideration
 
SimonTaylor
11-Garnet
Status changed to: Implementation In Progress

Hi

The chunky curves occur because ALD's own vector graphic tool does not make smooth curves. The 12.2.1.0 release will allow the images generated by MathJax to be passed directly to the PDFlib engine, which will produce much smoother curves. 

More information will be available when we release it

Simon