You are not logged in.
Pages: 1
Hi, I'm currently working on an internal project where I have to generate some PDF files. Currently I'm trying to draw some TMetafile objects on a the report canvas but I'm having some issues.
Basically when I tell the report canvas to draw my TMetafile it appears on the finished file with what appears to be some formatting errors. However, I know that the TMetafile object in question has been correctly created and formatted because when I use my application's form canvas (which is also a TCanvas object) it renders the TMetafile flawlessly.
I've tried a number of things including:
- Using the Draw function of the TVCLCanvas and TPdfCanvas;
- Using the RenderMetafile of the TVCLCanvas;
- Changing the TVCLCanvas to a TMetafileCanvas;
To be clear, I can draw the metafile but it is rendered with errors. Has anyone had this issue? I'm a little lost to be honest.
P.S: Unrelated but if anyone knows of a good library that can help me generate tables (like an excel table) into a PDF document I'd be much obliged;
Offline
How is the original metafile created?
Which commands do you use on the metafile?
Our renderer is not yet 100% accurate.
It works fine with simple metafile content, with text and drawings.
Complex transformations, clipping or transparency are not supported.
You can render simple tables using our TGdiPages report class.
Offline
The original metafile is created by another library I'm using that takes a LaTeX equation syntax and then returns it as a TMetafile.
It can also return it as a bitmap file which is rendered correctly on the canvas with no issues but is significantly heavier.
What seems to be happening is that the specific math symbols are not being recognized (like the integrals, infinite, stylized x an y symbols, etc...).
However, since the TVCLCanvas is a TCanvas (the same as the TForm canvas), I assumed that there would be no difference in the rendering between the both of them.
It seems like the symbols have the correct size (because I can select the "text" when visualizing the resulting PDF) but the rendering process doesn't know what to do with each symbol's "canvas".
Offline
Hi, sorry for the late reply.
Of course, here's WeTransfer link a zip with 2 EMF equations. I've confirmed they're correctly written.
Offline
It is weird.
The glyph indexes supplied to the drawtext command do not exist in the Cambria Math font itself...
So TPdfFontTrueType.GetAndMarkGlyphAsUsed can't find anything to draw and fallback to 0.
If we fallback to the supplied glyph index... it seems to be displayed as expected!
Please try
https://github.com/synopse/mORMot2/commit/a899ded4
Offline
Hi, so it seems somewhat better. However the symbols being used are not the correct ones.
It seems like there might still be an indexing issue.
It's currently looking like this:
https://freeimage.host/i/dqxLXMQ
And it should look like this:
https://freeimage.host/i/dqxLilI
Note: This second image is what is drawn when I export the equation as a bitmap.
(Sorry for the delays, I can only reply from home because my office IP was banned automatically by the forum )
Offline
Hi, have you had any progress with this issue?
We'd really like to know if this is an issue with the SynPDF library or the library that handles the equation metafile creation
Offline
Pages: 1