#1 2011-03-09 10:20:30

cjrh
Member
Registered: 2010-06-21
Posts: 7

Problems with render metafile EMF created by LibreOffice Draw

Using LibreOffice Draw, I export metafiles (as EMF) and when I try to add these metafiles to a pdf document, using Canvas.RenderMetafile(), there are various rendering problems and bounding boxes being drawn, and so on.  I have sent you an email (with attachment) about this.  This ticket is just so that we can have the issue logged for follow up.

Offline

#2 2011-03-09 19:10:44

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Problems with render metafile EMF created by LibreOffice Draw

Our metafile renderer is not complete.
It fulfilled our purpose (i.e. the data we had to process in our applications), with even some advanced features (like view or origin mapping).

Some problems come from the fact that there is no font-rolling-back feature: as documented, the used font must contain all necessary glyphs.
This is not the case outside the latin alphabet.

I'll take a look at these issues.
If you have some ideas, please look at the source code and try to figure out what's wrong.

I've put your file to this direct download link, if anyone want to help and fix the issues:
http://synopse.info/files/pdf/IssueEMF.zip

Offline

#3 2011-03-10 07:08:54

cjrh
Member
Registered: 2010-06-21
Posts: 7

Re: Problems with render metafile EMF created by LibreOffice Draw

Good idea.

Offline

#4 2011-03-11 06:16:08

cjrh
Member
Registered: 2010-06-21
Posts: 7

Re: Problems with render metafile EMF created by LibreOffice Draw

I have fixed an issue I was having with EMF files.   Currently, SynPDF renders EMF files correctly.  The files I uploaded, and the problems described in the original report either no longer occur, or do not occur in the same way when using EMF files as opposed to WMF files.   Hence, I will continue using WMF files.   

Font fallback for multilingual fonts remains an issue, however.  I am finding that I need to specify the same font for all text in my EMF in order to get SynPDF to render the fonts correctly, and even then, some fonts (seems to be those inside font collection .ttc files??) don't render anyway.   I'll look into the font issue again at a later stage.

Offline

#5 2011-03-11 08:34:05

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Problems with render metafile EMF created by LibreOffice Draw

I don't get the EMF/WMF purpose you talk about.
Could you explain a bit more, please?

Font fallback must be coded inside UniScribe support.
See TPdfWrite.AddGlyphs method.
It must be coded in TPdfCanvas.ShowGlyph method, I think, because it will need font change.

Offline

#6 2011-03-11 10:51:54

cjrh
Member
Registered: 2010-06-21
Posts: 7

Re: Problems with render metafile EMF created by LibreOffice Draw

Sorry, I am causing confusion.   I was using WMF files instead of EMF files, because I was having problems with EMF files and embedded StretchDIBits images (the images would go missing).   That issue has now been resolved because I now do my EMF drawing using GDI+ instead of GDI.  This had nothing to do with SynPDF.

During my earlier testing, I had observed that SynPDF would put "blocks" or "borders" around all graphic elements in my WMF files when adding them, but it would not do that with EMF files, which is why I was focusing on EMF files in my upload of the demo project.   Of course, the problem with WMF files is still there if you look at "langbad-original.pdf" which imports "langbad.emf" which was created by embedding a WMF file inside an EMF file.   It's a bit confusing, I hope I am making sense.

Anyway, it now turns out that my issues with SynPDF have not been solved by my new EMF drawing method anyway, because the graphic corruption in "boxes-original.pdf" is still there, and the boxes in "langbad-original.pdf" are also still there.

Regarding Uniscribe, Uniscribe:=True seems to not respect the character width on some Asian fonts with wide characters.   However, Uniscribe:=True does at least show the characters, as you pointed out.

I am doing further testing.

Offline

Board footer

Powered by FluxBB