|
OKO <yuanjiabei@gmail.com> wrote in message
<d25ee624-f5e5-4564-9560-d3fa5e925835@e6g2000prf.googlegroups.com>...
> I used patch in Matlab to generate transparent object for
a figure.
> Then the figure need to be exported into a pdf file. The last
> requirement is that, in the generated pdf file, the values
(axis and
> characters) need to be searchable, that means you can use
text-cursor
> to select those single value or characters.
>
> I tried two methods, but each of them only reach partially my
> requirement. So I was wondering if anyone can find a
complete solution
> to this.
>
> Thanks in advance.
>
> OKO
>
>
> Matlab Codes:
>
> %_____figure with a transparent object:______
>
> x = [0.8, 1.6, 1.6, 1.2, 0.8];
> y = [0.6, 1.2, 1.2, 0.9, 0.6];
> z = [1, 1, 2, 1.7, 2];
> patch(x, y, z, 'g','EdgeColor','none','FaceAlpha',0.3)
> axis equal
> box on
> view([35, 30])
>
> %______Solution 1:_____________________
> print('-painters','-dpdf','-r100','c:\test.pdf')
> %this is similar as using 'copy figure' in menu, paste
into word, and
> print as adobe pdf file
> %the drawback of this method is that, the transparent
object in the
> figure becomes non-transparent!
>
> %______Solution 2:_____________________
> print('-dtiff','-noui','-r100','c:\1')
> %create a tif file and then convert it into pdf using adobe
> professional 8.0
> %the figure in pdf is non-searchable
>
> The
> advantage and
> disadvantage
> Solution 1 value in pdf is
> searchable lose
transparent
> object
> Solution 2 transparent object kept in
> pdf vaues in pdf is not
> searchable
>
As you've seen, each of the renderers have different
capabilities - painters, which allows you to make a
searchable pdf doesn't support transparency; opengl supports
transparency, but doesn't generate vector output (required
to be searchable).
You **MIGHT** be able to use exportfig from the file
exchange to output the text and graphics into 2 separate
files and then combine them (there's an epscombine also on
the file exchange)... Finally, you could call out to
ghostscript to convert the eps file into a pdf...
It's not pretty, but it might work.
-
Richard Quist
Software Developer
The MathWorks, Inc.
|