<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165705</link>
    <title>MATLAB Central Newsreader - Print figures with a patch object into a searchable pdf file</title>
    <description>Feed for thread: Print figures with a patch object into a searchable pdf file</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 14 Mar 2008 21:36:00 -0400</pubDate>
      <title>Print figures with a patch object into a searchable pdf file</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165705#420982</link>
      <author>OKO</author>
      <description>I used patch in Matlab to generate transparent object for a figure.&lt;br&gt;
Then the figure need to be exported into a pdf file. The last&lt;br&gt;
requirement is that, in the generated pdf file, the values (axis and&lt;br&gt;
characters) need to be searchable, that means you can use text-cursor&lt;br&gt;
to select those single value or characters.&lt;br&gt;
&lt;br&gt;
I tried two methods, but each of them only reach partially my&lt;br&gt;
requirement. So I was wondering if anyone can find a complete solution&lt;br&gt;
to this.&lt;br&gt;
&lt;br&gt;
Thanks in advance.&lt;br&gt;
&lt;br&gt;
OKO&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Matlab Codes:&lt;br&gt;
&lt;br&gt;
%_____figure with a transparent object:______&lt;br&gt;
&lt;br&gt;
x = [0.8, 1.6, 1.6, 1.2, 0.8];&lt;br&gt;
y = [0.6, 1.2, 1.2, 0.9, 0.6];&lt;br&gt;
z = [1, 1, 2, 1.7, 2];&lt;br&gt;
patch(x, y, z, 'g','EdgeColor','none','FaceAlpha',0.3)&lt;br&gt;
axis equal&lt;br&gt;
box on&lt;br&gt;
view([35, 30])&lt;br&gt;
&lt;br&gt;
%______Solution 1:_____________________&lt;br&gt;
print('-painters','-dpdf','-r100','c:\test.pdf')&lt;br&gt;
%this is similar as using 'copy figure' in menu, paste into word, and&lt;br&gt;
print as adobe pdf file&lt;br&gt;
%the drawback of this method is that, the transparent object in the&lt;br&gt;
figure becomes non-transparent!&lt;br&gt;
&lt;br&gt;
%______Solution 2:_____________________&lt;br&gt;
print('-dtiff','-noui','-r100','c:\1')&lt;br&gt;
%create a tif file and then convert it into pdf using adobe&lt;br&gt;
professional 8.0&lt;br&gt;
%the figure in pdf is non-searchable&lt;br&gt;
&lt;br&gt;
The&lt;br&gt;
advantage                           and&lt;br&gt;
disadvantage&lt;br&gt;
Solution 1                          value in pdf is&lt;br&gt;
searchable                                      lose transparent&lt;br&gt;
object&lt;br&gt;
Solution 2                       transparent object kept in&lt;br&gt;
pdf                          vaues in pdf is not&lt;br&gt;
searchable</description>
    </item>
    <item>
      <pubDate>Fri, 28 Mar 2008 00:02:01 -0400</pubDate>
      <title>Re: Print figures with a patch object into a searchable pdf file</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165705#423235</link>
      <author>Richard Quist</author>
      <description>OKO &amp;lt;yuanjiabei@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;d25ee624-f5e5-4564-9560-d3fa5e925835@e6g2000prf.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; I used patch in Matlab to generate transparent object for&lt;br&gt;
a figure.&lt;br&gt;
&amp;gt; Then the figure need to be exported into a pdf file. The last&lt;br&gt;
&amp;gt; requirement is that, in the generated pdf file, the values&lt;br&gt;
(axis and&lt;br&gt;
&amp;gt; characters) need to be searchable, that means you can use&lt;br&gt;
text-cursor&lt;br&gt;
&amp;gt; to select those single value or characters.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I tried two methods, but each of them only reach partially my&lt;br&gt;
&amp;gt; requirement. So I was wondering if anyone can find a&lt;br&gt;
complete solution&lt;br&gt;
&amp;gt; to this.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks in advance.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; OKO&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Matlab Codes:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; %_____figure with a transparent object:______&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; x = [0.8, 1.6, 1.6, 1.2, 0.8];&lt;br&gt;
&amp;gt; y = [0.6, 1.2, 1.2, 0.9, 0.6];&lt;br&gt;
&amp;gt; z = [1, 1, 2, 1.7, 2];&lt;br&gt;
&amp;gt; patch(x, y, z, 'g','EdgeColor','none','FaceAlpha',0.3)&lt;br&gt;
&amp;gt; axis equal&lt;br&gt;
&amp;gt; box on&lt;br&gt;
&amp;gt; view([35, 30])&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; %______Solution 1:_____________________&lt;br&gt;
&amp;gt; print('-painters','-dpdf','-r100','c:\test.pdf')&lt;br&gt;
&amp;gt; %this is similar as using 'copy figure' in menu, paste&lt;br&gt;
into word, and&lt;br&gt;
&amp;gt; print as adobe pdf file&lt;br&gt;
&amp;gt; %the drawback of this method is that, the transparent&lt;br&gt;
object in the&lt;br&gt;
&amp;gt; figure becomes non-transparent!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; %______Solution 2:_____________________&lt;br&gt;
&amp;gt; print('-dtiff','-noui','-r100','c:\1')&lt;br&gt;
&amp;gt; %create a tif file and then convert it into pdf using adobe&lt;br&gt;
&amp;gt; professional 8.0&lt;br&gt;
&amp;gt; %the figure in pdf is non-searchable&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The&lt;br&gt;
&amp;gt; advantage                           and&lt;br&gt;
&amp;gt; disadvantage&lt;br&gt;
&amp;gt; Solution 1                          value in pdf is&lt;br&gt;
&amp;gt; searchable                                      lose&lt;br&gt;
transparent&lt;br&gt;
&amp;gt; object&lt;br&gt;
&amp;gt; Solution 2                       transparent object kept in&lt;br&gt;
&amp;gt; pdf                          vaues in pdf is not&lt;br&gt;
&amp;gt; searchable&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
As you've seen, each of the renderers have different&lt;br&gt;
capabilities - painters, which allows you to make a&lt;br&gt;
searchable pdf doesn't support transparency; opengl supports&lt;br&gt;
transparency, but doesn't generate vector output (required&lt;br&gt;
to be searchable). &lt;br&gt;
&lt;br&gt;
You **MIGHT** be able to use exportfig from the file&lt;br&gt;
exchange to output the text and graphics into 2 separate&lt;br&gt;
files and then combine them (there's an epscombine also on&lt;br&gt;
the file exchange)... Finally, you could call out to&lt;br&gt;
ghostscript to convert the eps file into a pdf...&lt;br&gt;
&lt;br&gt;
It's not pretty, but it might work.&lt;br&gt;
&lt;br&gt;
-&lt;br&gt;
&lt;br&gt;
Richard Quist&lt;br&gt;
Software Developer&lt;br&gt;
The MathWorks, Inc.</description>
    </item>
    <item>
      <pubDate>Thu, 11 Mar 2010 18:29:21 -0500</pubDate>
      <title>Re: Print figures with a patch object into a searchable pdf file</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165705#725592</link>
      <author>Christopher Hummersone</author>
      <description>OKO &amp;lt;yuanjiabei@gmail.com&amp;gt; wrote in message &amp;lt;d25ee624-f5e5-4564-9560-d3fa5e925835@e6g2000prf.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; I used patch in Matlab to generate transparent object for a figure.&lt;br&gt;
&amp;gt; Then the figure need to be exported into a pdf file. The last&lt;br&gt;
&amp;gt; requirement is that, in the generated pdf file, the values (axis and&lt;br&gt;
&amp;gt; characters) need to be searchable, that means you can use text-cursor&lt;br&gt;
&amp;gt; to select those single value or characters.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I tried two methods, but each of them only reach partially my&lt;br&gt;
&amp;gt; requirement. So I was wondering if anyone can find a complete solution&lt;br&gt;
&amp;gt; to this.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks in advance.&lt;br&gt;
&lt;br&gt;
[snip]&lt;br&gt;
&lt;br&gt;
I know this reply is a bit random but I googled for this, couldn't find a solution, but now have one so thought I would share it.&lt;br&gt;
&lt;br&gt;
So if you want to:&lt;br&gt;
- plot lines&lt;br&gt;
- use patch objects (perhaps to shade regions) that are transparent&lt;br&gt;
- export to PDF&lt;br&gt;
&lt;br&gt;
You can overlay the line(s) on the patch object(s) instead of using transparency:&lt;br&gt;
- Use plot3 instead of plot, set the Z-data to be ones the same size as X or Y&lt;br&gt;
- Set Z in patch to be zeros the same size as X or Y&lt;br&gt;
- Export to PDF as usual&lt;br&gt;
&lt;br&gt;
Hope this helps someone sometime!&lt;br&gt;
&lt;br&gt;
Chris</description>
    </item>
  </channel>
</rss>

