Issue 76854 - PDF conversion problem with Matlab figures.
Summary: PDF conversion problem with Matlab figures.
Status: ACCEPTED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: OOo 2.2
Hardware: PC Windows, all
: P3 Trivial with 2 votes (vote)
Target Milestone: OOo 3.x
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-02 13:39 UTC by cnav39
Modified: 2017-05-20 11:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Original document with a Matlab figure. (9.74 KB, application/vnd.sun.xml.writer)
2007-05-02 13:41 UTC, cnav39
no flags Details
PDF file generated from MatlabFigure.odt (11.46 KB, application/pdf)
2007-05-02 13:42 UTC, cnav39
no flags Details
Original document with a 2 Matlab figures. (12.95 KB, application/vnd.oasis.opendocument.text)
2007-05-03 10:24 UTC, cnav39
no flags Details
PDF file generated from MatlabFigure1.odt (39.19 KB, application/pdf)
2007-05-03 10:25 UTC, cnav39
no flags Details
OO2 document with Equation 3 object from MS Word. (9.41 KB, application/vnd.sun.xml.writer)
2007-06-22 11:04 UTC, cnav39
no flags Details
PDF file generated from Equation.odt using PDF export (12.97 KB, application/pdf)
2007-06-22 11:07 UTC, cnav39
no flags Details
PDF file generated from Equation.odt using CutePDF printer driver (6.25 KB, application/pdf)
2007-06-22 11:08 UTC, cnav39
no flags Details
Matlab Figure in Word. (23.50 KB, application/msword)
2008-06-06 14:46 UTC, cnav39
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description cnav39 2007-05-02 13:39:12 UTC
There seems to be some problem with fonts when I export a document to PDF
format. This appears only in figures generated with Matlab and pasted as a
metafile. The fonts appear very narrow in these figures when I open the PDF
file. It all looks fine in the original document and I can also print without
any problem. This seems to be common to all applications (text, draw, impress
and calc). I can supply example files if necessary.
Comment 1 cnav39 2007-05-02 13:41:20 UTC
Created attachment 44805 [details]
Original document with a Matlab figure.
Comment 2 cnav39 2007-05-02 13:42:46 UTC
Created attachment 44806 [details]
PDF file generated from MatlabFigure.odt
Comment 3 cnav39 2007-05-02 13:45:08 UTC
I have attached two files (odt and pdf) which illustrate the problem.
Comment 4 philipp.lohmann 2007-05-02 18:30:26 UTC
confirm
Comment 5 philipp.lohmann 2007-05-02 18:36:31 UTC
pl->hdu: One can see the same behaviour displaying the document on a Unix
version independent of display, print or PDF export. I suspect that the problem
lies in the font being neither embeddable nor subsettable, so that a substituted
font gets used. The characters seem to be positioned individually in the
metafile, so there is not much we could do but pick  a font that fits the
metrics better. The font seems to be originally monospaced I think.
Comment 6 cnav39 2007-05-03 10:23:36 UTC
I have done some more testing and it seems like something is missing in Matlab
generated metafiles. Matlab uses Arial Font by default not a mono spaced font. I
just wanted to check this and went into text properties in Matlab and confirmed
Arial. After copying the Figure again into OO the problem has disappeared, i.e.
generated PDF is fine. I am attaching two more files (odt and pdf) with two
identical Figures, one pasted directly after plotting in Matlab and the other
after confirming Arial Font using text properties of all elements. The font
information seems to be there in the original figure too as you can see these
figures look the same in the OO document but the PDF conversion somehow does it
differently. I am not a programmer so cannot say where the problem is, only
writing my observations. I noticed that I had to confirm text properties
individually for each text component (x label, y label and axes numbers) in
order to fix the whole figure. This is rather tedious so it would be great if it
could be fixed somehow.
Comment 7 cnav39 2007-05-03 10:24:42 UTC
Created attachment 44827 [details]
Original document with a 2 Matlab figures.
Comment 8 cnav39 2007-05-03 10:25:12 UTC
Created attachment 44828 [details]
PDF file generated from MatlabFigure1.odt
Comment 9 hdu@apache.org 2007-05-15 14:27:21 UTC
I'll try to fix it for OOo3.
Comment 10 cnav39 2007-06-22 11:04:57 UTC
Created attachment 46172 [details]
OO2 document with Equation 3 object from MS Word.
Comment 11 cnav39 2007-06-22 11:07:28 UTC
Created attachment 46173 [details]
PDF file generated from Equation.odt using PDF export
Comment 12 cnav39 2007-06-22 11:08:31 UTC
Created attachment 46174 [details]
PDF file generated from Equation.odt using CutePDF printer driver
Comment 13 cnav39 2007-06-22 11:13:52 UTC
I have attached 3 more files. It appears that the same effect (narrow fonts in
PDF exports) can be seen in Equation objects created in Word. I assume this is
the same issue so I posted it here. However, when I print to PDF using a PDF
printer driver everything is OK. It seems this is not Matlab specific problem. I
hope this is useful.
Comment 14 hdu@apache.org 2007-06-22 14:46:58 UTC
hdu reminder: does vcl/source/gdi/cvtsvm.cxx GDI_FONT_ACTION needs to adjust the absolute font width 
to the system specific relative font width? This would explain the original problem, but this doesn't explain 
the PDF-exported formula... maybe PDFWriterImpl::emitEmbeddedFont() needs some map-mode 
adjustment too.
Comment 15 hdu@apache.org 2008-06-02 12:02:06 UTC
retargeting
Comment 16 cnav39 2008-06-06 14:46:48 UTC
Created attachment 54301 [details]
Matlab Figure in Word.
Comment 17 cnav39 2008-06-06 14:54:47 UTC
I have recently installed Ubuntu 8.04 on my laptop and can provide a few more
comments:
1. When I open the attached OO documents MatlabFigure.odt and MatlabFigure1.odt
in Linux they already look wrong, i.e. the same a the exported PDF. I didn't
know this as in Windows they will open fine (but the exported PDF is not OK as I
said before).
2. The Equation.odt document opens fine in Linux and also looks OK when export
it to PDF (unlike Windows system).
3. When I paste a Matlab figure into Word as an Enhanced Metafile and save it
(see my last attachment) then it opens fine (in Linux and in Windows) and
converts fine to PDF (in Linux but not in Windows!)
Does it make any sense? I am not sure... maybe this is something to do with
pasting. In word you have a choice of metafile or enhanced metafile. 
Comment 18 Marcus 2017-05-20 11:29:19 UTC
Reset assigne to the default "issues@openoffice.apache.org".