0

I created a drawing in Powerpoint and saved it as .pdf

I then converted it to .eps

Trying to use psfrag however does not seem to work:

Try 1

pdflatex --shell-escape

\documentclass{article}
\usepackage{pstool}
\begin{document}
\begin{center}
\psfrag{A}{\textit{test}}
\psfragfig{Presentation6}
\end{center}
\end{document}

Output:

enter image description here

which is basically the original image.

Try 2

pdflatex --shell-escape

\documentclass{article}
\usepackage{auto-pst-pdf}
\begin{document}
\begin{center}
\begin{postscript}
\psfrag{A}{\textit{test}}
\includegraphics{Presentation6.eps}
\end{postscript}
\end{center}
\end{document}

Output: enter image description here

Try 3

latex dvips ps2pdf

I used quickbuild with

enter image description here

\documentclass{article}
\usepackage{graphicx,psfrag}
\begin{document}
\psfrag{A}{\textit{test}}
\includegraphics{Presentation6.eps}
\end{document}

Output: enter image description here

Settings: enter image description here

Question

How can I replace text from images created with powerpoint?

edit: part of eps file

/DeviceGray {} cs
[0] sc
/DeviceGray {} CS
[0] SC
/F8_0 18 Tf
(A)
[10.422
0] Tj
Q
Q
Q
Q
showpage
%%PageTrailer
pdfEndPage
%%Trailer
end
%%DocumentSuppliedResources:
%%+ font BCDEEE+Calibri
%%EOF

edit2: more of the eps file

%!PS-Adobe-3.0 EPSF-3.0
%Produced by poppler pdftops version: 0.60.1 (http://poppler.freedesktop.org)
%%Creator: TeX
%%LanguageLevel: 2
%%DocumentSuppliedResources: (atend)
%%BoundingBox: 0 0 122 12
%%HiResBoundingBox: 0 0 122 12
%%DocumentSuppliedResources: (atend)
%%EndComments
%%BeginProlog
%%BeginResource: procset xpdf 3.00 0
%%Copyright: Copyright 1996-2011 Glyph & Cog, LLC
/xpdf 75 dict def xpdf begin
% PDF special state
/pdfDictSize 15 def
/pdfSetup {
  /setpagedevice where {
    pop 2 dict begin
      /Policies 1 dict dup begin /PageSize 6 def end def
      { /Duplex true def } if
    currentdict end setpagedevice
  } {
    pop
  } ifelse
} def
/pdfSetupPaper {
  % Change paper size, but only if different from previous paper size otherwise
  % duplex fails. PLRM specifies a tolerance of 5 pts when matching paper size
  % so we use the same when checking if the size changes.
  /setpagedevice where {
    pop currentpagedevice
    /PageSize known {
      2 copy
      currentpagedevice /PageSize get aload pop
      exch 4 1 roll
      sub abs 5 gt
      3 1 roll
      sub abs 5 gt
      or
    } {
      true
    } ifelse
    {
      2 array astore
      2 dict begin
        /PageSize exch def
        /ImagingBBox null def
      currentdict end
      setpagedevice
    } {
      pop pop
    } ifelse
  } {
    pop
  } ifelse
} def
/pdfStartPage {
  pdfDictSize dict begin
  /pdfFillCS [] def
  /pdfFillXform {} def
  /pdfStrokeCS [] def
  /pdfStrokeXform {} def
  /pdfFill [0] def
  /pdfStroke [0] def
  /pdfFillOP false def
  /pdfStrokeOP false def
  /pdfLastFill false def
  /pdfLastStroke false def
  /pdfTextMat [1 0 0 1 0 0] def
  /pdfFontSize 0 def
  /pdfCharSpacing 0 def
  /pdfTextRender 0 def
  /pdfPatternCS false def
  /pdfTextRise 0 def
  /pdfWordSpacing 0 def
  /pdfHorizScaling 1 def
  /pdfTextClipPath [] def
} def
/pdfEndPage { end } def
% PDF color state
/cs { /pdfFillXform exch def dup /pdfFillCS exch def
      setcolorspace } def
/CS { /pdfStrokeXform exch def dup /pdfStrokeCS exch def
      setcolorspace } def
/sc { pdfLastFill not { pdfFillCS setcolorspace } if
      dup /pdfFill exch def aload pop pdfFillXform setcolor
     /pdfLastFill true def /pdfLastStroke false def } def
/SC { pdfLastStroke not { pdfStrokeCS setcolorspace } if
      dup /pdfStroke exch def aload pop pdfStrokeXform setcolor
     /pdfLastStroke true def /pdfLastFill false def } def
/op { /pdfFillOP exch def
      pdfLastFill { pdfFillOP setoverprint } if } def
/OP { /pdfStrokeOP exch def
      pdfLastStroke { pdfStrokeOP setoverprint } if } def
/fCol {
  pdfLastFill not {
    pdfFillCS setcolorspace
    pdfFill aload pop pdfFillXform setcolor
    pdfFillOP setoverprint
    /pdfLastFill true def /pdfLastStroke false def
  } if
} def
/sCol {
  pdfLastStroke not {
    pdfStrokeCS setcolorspace
    pdfStroke aload pop pdfStrokeXform setcolor
    pdfStrokeOP setoverprint
    /pdfLastStroke true def /pdfLastFill false def
  } if
} def
% build a font
/pdfMakeFont {
  4 3 roll findfont
  4 2 roll matrix scale makefont
  dup length dict begin
    { 1 index /FID ne { def } { pop pop } ifelse } forall
    /Encoding exch def
    currentdict
  end
  definefont pop
} def
/pdfMakeFont16 {
  exch findfont
  dup length dict begin
    { 1 index /FID ne { def } { pop pop } ifelse } forall
    /WMode exch def
    currentdict
  end
  definefont pop
} def
% graphics state operators
/q { gsave pdfDictSize dict begin } def
/Q {
  end grestore
  /pdfLastFill where {
    pop
    pdfLastFill {
      pdfFillOP setoverprint
    } {
      pdfStrokeOP setoverprint
    } ifelse
  } if
} def
/cm { concat } def
/d { setdash } def
/i { setflat } def
/j { setlinejoin } def
/J { setlinecap } def
/M { setmiterlimit } def
/w { setlinewidth } def
% path segment operators
/m { moveto } def
/l { lineto } def
/c { curveto } def
/re { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
      neg 0 rlineto closepath } def
/h { closepath } def
% path painting operators
/S { sCol stroke } def
/Sf { fCol stroke } def
/f { fCol fill } def
/f* { fCol eofill } def
% clipping operators
/W { clip newpath } def
/W* { eoclip newpath } def
/Ws { strokepath clip newpath } def
% text state operators
/Tc { /pdfCharSpacing exch def } def
/Tf { dup /pdfFontSize exch def
      dup pdfHorizScaling mul exch matrix scale
      pdfTextMat matrix concatmatrix dup 4 0 put dup 5 0 put
      exch findfont exch makefont setfont } def
/Tr { /pdfTextRender exch def } def
/Tp { /pdfPatternCS exch def } def
/Ts { /pdfTextRise exch def } def
/Tw { /pdfWordSpacing exch def } def
/Tz { /pdfHorizScaling exch def } def
% text positioning operators
/Td { pdfTextMat transform moveto } def
/Tm { /pdfTextMat exch def } def
% text string operators
/xyshow where {
  pop
  /xyshow2 {
    dup length array
    0 2 2 index length 1 sub {
      2 index 1 index 2 copy get 3 1 roll 1 add get
      pdfTextMat dtransform
      4 2 roll 2 copy 6 5 roll put 1 add 3 1 roll dup 4 2 roll put
    } for
    exch pop
    xyshow
  } def
}{
  /xyshow2 {
    currentfont /FontType get 0 eq {
      0 2 3 index length 1 sub {
        currentpoint 4 index 3 index 2 getinterval show moveto
        2 copy get 2 index 3 2 roll 1 add get
        pdfTextMat dtransform rmoveto
      } for
    } {
      0 1 3 index length 1 sub {
        currentpoint 4 index 3 index 1 getinterval show moveto
        2 copy 2 mul get 2 index 3 2 roll 2 mul 1 add get
        pdfTextMat dtransform rmoveto
      } for
    } ifelse
    pop pop
  } def
} ifelse
/cshow where {
  pop
  /xycp {
    0 3 2 roll
    {
      pop pop currentpoint 3 2 roll
      1 string dup 0 4 3 roll put false charpath moveto
      2 copy get 2 index 2 index 1 add get
      pdfTextMat dtransform rmoveto
      2 add
    } exch cshow
    pop pop
  } def
}{
  /xycp {
    currentfont /FontType get 0 eq {
      0 2 3 index length 1 sub {
        currentpoint 4 index 3 index 2 getinterval false charpath moveto
        2 copy get 2 index 3 2 roll 1 add get
        pdfTextMat dtransform rmoveto
      } for
    } {
      0 1 3 index length 1 sub {
        currentpoint 4 index 3 index 1 getinterval false charpath moveto
        2 copy 2 mul get 2 index 3 2 roll 2 mul 1 add get
        pdfTextMat dtransform rmoveto
      } for
    } ifelse
    pop pop
  } def
} ifelse
/Tj {
  fCol
  0 pdfTextRise pdfTextMat dtransform rmoveto
  currentpoint 4 2 roll
  pdfTextRender 1 and 0 eq {
    2 copy xyshow2
  } if
  pdfTextRender 3 and dup 1 eq exch 2 eq or {
    3 index 3 index moveto
    2 copy
    currentfont /FontType get 3 eq { fCol } { sCol } ifelse
    xycp currentpoint stroke moveto
  } if
  pdfTextRender 4 and 0 ne {
    4 2 roll moveto xycp
    /pdfTextClipPath [ pdfTextClipPath aload pop
      {/moveto cvx}
      {/lineto cvx}
      {/curveto cvx}
      {/closepath cvx}
    pathforall ] def
    currentpoint newpath moveto
  } {
    pop pop pop pop
  } ifelse
  0 pdfTextRise neg pdfTextMat dtransform rmoveto
} def
/TJm { 0.001 mul pdfFontSize mul pdfHorizScaling mul neg 0
       pdfTextMat dtransform rmoveto } def
/TJmV { 0.001 mul pdfFontSize mul neg 0 exch
        pdfTextMat dtransform rmoveto } def
/Tclip { pdfTextClipPath cvx exec clip newpath
         /pdfTextClipPath [] def } def
/Tclip* { pdfTextClipPath cvx exec eoclip newpath
         /pdfTextClipPath [] def } def
% Level 2/3 image operators
/pdfImBuf 100 string def
/pdfImStr {
  2 copy exch length lt {
    2 copy get exch 1 add exch
  } {
    ()
  } ifelse
} def
/skipEOD {
  { currentfile pdfImBuf readline
    not { pop exit } if
    (%-EOD-) eq { exit } if } loop
} def
/pdfIm { image skipEOD } def
/pdfImM { fCol imagemask skipEOD } def
/pr { 2 index 2 index 3 2 roll putinterval 4 add } def
/pdfImClip {
  gsave
  0 2 4 index length 1 sub {
    dup 4 index exch 2 copy
    get 5 index div put
    1 add 3 index exch 2 copy
    get 3 index div put
  } for
  pop pop rectclip
} def
/pdfImClipEnd { grestore } def
% shading operators
/colordelta {
  false 0 1 3 index length 1 sub {
    dup 4 index exch get 3 index 3 2 roll get sub abs 0.004 gt {
      pop true
    } if
  } for
  exch pop exch pop
} def
/funcCol { func n array astore } def
/funcSH {
  dup 0 eq {
    true
  } {
    dup 6 eq {
      false
    } {
      4 index 4 index funcCol dup
      6 index 4 index funcCol dup
      3 1 roll colordelta 3 1 roll
      5 index 5 index funcCol dup
      3 1 roll colordelta 3 1 roll
      6 index 8 index funcCol dup
      3 1 roll colordelta 3 1 roll
      colordelta or or or
    } ifelse
  } ifelse
  {
    1 add
    4 index 3 index add 0.5 mul exch 4 index 3 index add 0.5 mul exch
    6 index 6 index 4 index 4 index 4 index funcSH
    2 index 6 index 6 index 4 index 4 index funcSH
    6 index 2 index 4 index 6 index 4 index funcSH
    5 3 roll 3 2 roll funcSH pop pop
  } {
    pop 3 index 2 index add 0.5 mul 3 index  2 index add 0.5 mul
    funcCol sc
    dup 4 index exch mat transform m
    3 index 3 index mat transform l
    1 index 3 index mat transform l
    mat transform l pop pop h f*
  } ifelse
} def
/axialCol {
  dup 0 lt {
    pop t0
  } {
    dup 1 gt {
      pop t1
    } {
      dt mul t0 add
    } ifelse
  } ifelse
  func n array astore
} def
/axialSH {
  dup 0 eq {
    true
  } {
    dup 8 eq {
      false
    } {
      2 index axialCol 2 index axialCol colordelta
    } ifelse
  } ifelse
  {
    1 add 3 1 roll 2 copy add 0.5 mul
    dup 4 3 roll exch 4 index axialSH
    exch 3 2 roll axialSH
  } {
    pop 2 copy add 0.5 mul
    axialCol sc
    exch dup dx mul x0 add exch dy mul y0 add
    3 2 roll dup dx mul x0 add exch dy mul y0 add
    dx abs dy abs ge {
      2 copy yMin sub dy mul dx div add yMin m
      yMax sub dy mul dx div add yMax l
      2 copy yMax sub dy mul dx div add yMax l
      yMin sub dy mul dx div add yMin l
      h f*
    } {
      exch 2 copy xMin sub dx mul dy div add xMin exch m
      xMax sub dx mul dy div add xMax exch l
      exch 2 copy xMax sub dx mul dy div add xMax exch l
      xMin sub dx mul dy div add xMin exch l
      h f*
    } ifelse
  } ifelse
} def
/radialCol {
  dup t0 lt {
    pop t0
  } {
    dup t1 gt {
      pop t1
    } if
  } ifelse
  func n array astore
} def
/radialSH {
  dup 0 eq {
    true
  } {
    dup 8 eq {
      false
    } {
      2 index dt mul t0 add radialCol
      2 index dt mul t0 add radialCol colordelta
    } ifelse
  } ifelse
  {
    1 add 3 1 roll 2 copy add 0.5 mul
    dup 4 3 roll exch 4 index radialSH
    exch 3 2 roll radialSH
  } {
    pop 2 copy add 0.5 mul dt mul t0 add
    radialCol sc
    encl {
      exch dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
      0 360 arc h
      dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
      360 0 arcn h f
    } {
      2 copy
      dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
      a1 a2 arcn
      dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
      a2 a1 arcn h
      dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
      a1 a2 arc
      dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add
      a2 a1 arc h f
    } ifelse
  } ifelse
} def
end
%%EndResource
%%EndProlog
%%BeginSetup
xpdf begin
%%BeginResource: font BCDEEE+Calibri
%!PS-TrueTypeFont- 1
10 dict begin
/FontName /BCDEEE+Calibri def
/FontType 42 def
/FontMatrix [1 0 0 1 0 0] def
/FontBBox [-1030 -640 2540 2102] def
/PaintType 0 def
/Encoding 256 array
dup 0 /.notdef put
dup 1 /.notdef put
dup 2 /.notdef put
dup 3 /.notdef put
dup 4 /.notdef put
dup 5 /.notdef put
dup 6 /.notdef put
dup 7 /.notdef put
dup 8 /.notdef put
dup 9 /.notdef put
dup 10 /.notdef put
dup 11 /.notdef put
dup 12 /.notdef put
dup 13 /.notdef put
dup 14 /.notdef put
dup 15 /.notdef put
dup 16 /.notdef put
dup 17 /.notdef put
dup 18 /.notdef put
dup 19 /.notdef put
dup 20 /.notdef put
dup 21 /.notdef put
dup 22 /.notdef put
dup 23 /.notdef put
dup 24 /.notdef put
dup 25 /.notdef put
dup 26 /.notdef put
dup 27 /.notdef put
dup 28 /.notdef put
dup 29 /.notdef put
dup 30 /.notdef put
dup 31 /.notdef put
dup 32 /space put
dup 33 /exclam put
dup 34 /quotedbl put
dup 35 /numbersign put
dup 36 /dollar put
dup 37 /percent put
dup 38 /ampersand put
dup 39 /quotesingle put
dup 40 /parenleft put
dup 41 /parenright put
dup 42 /asterisk put
dup 43 /plus put
dup 44 /comma put
dup 45 /hyphen put
dup 46 /period put
dup 47 /slash put
dup 48 /zero put
dup 49 /one put
dup 50 /two put
dup 51 /three put
dup 52 /four put
dup 53 /five put
dup 54 /six put
dup 55 /seven put
dup 56 /eight put
dup 57 /nine put
dup 58 /colon put
dup 59 /semicolon put
dup 60 /less put
dup 61 /equal put
dup 62 /greater put
dup 63 /question put
dup 64 /at put
dup 65 /A put
dup 66 /B put
dup 67 /C put
dup 68 /D put
dup 69 /E put
dup 70 /F put
dup 71 /G put
dup 72 /H put
dup 73 /I put
dup 74 /J put
dup 75 /K put
dup 76 /L put
dup 77 /M put
dup 78 /N put
dup 79 /O put
dup 80 /P put
dup 81 /Q put
dup 82 /R put
dup 83 /S put
dup 84 /T put
dup 85 /U put
dup 86 /V put
dup 87 /W put
dup 88 /X put
dup 89 /Y put
dup 90 /Z put
dup 91 /bracketleft put
dup 92 /backslash put
dup 93 /bracketright put
dup 94 /asciicircum put
dup 95 /underscore put
dup 96 /grave put
dup 97 /a put
dup 98 /b put
dup 99 /c put
dup 100 /d put
dup 101 /e put
dup 102 /f put
dup 103 /g put
dup 104 /h put
dup 105 /i put
dup 106 /j put
dup 107 /k put
dup 108 /l put
dup 109 /m put
dup 110 /n put
dup 111 /o put
dup 112 /p put
dup 113 /q put
dup 114 /r put
dup 115 /s put
dup 116 /t put
dup 117 /u put
dup 118 /v put
dup 119 /w put
dup 120 /x put
dup 121 /y put
dup 122 /z put
dup 123 /braceleft put
dup 124 /bar put
dup 125 /braceright put
dup 126 /asciitilde put
dup 127 /bullet put
dup 128 /Euro put
dup 129 /bullet put
dup 130 /quotesinglbase put
dup 131 /florin put
dup 132 /quotedblbase put
dup 133 /ellipsis put
dup 134 /dagger put
dup 135 /daggerdbl put
dup 136 /circumflex put
dup 137 /perthousand put
dup 138 /Scaron put
dup 139 /guilsinglleft put
dup 140 /OE put
dup 141 /bullet put
dup 142 /Zcaron put
dup 143 /bullet put
dup 144 /bullet put
dup 145 /quoteleft put
dup 146 /quoteright put
dup 147 /quotedblleft put
dup 148 /quotedblright put
dup 149 /bullet put
dup 150 /endash put
dup 151 /emdash put
dup 152 /tilde put
dup 153 /trademark put
dup 154 /scaron put
dup 155 /guilsinglright put
dup 156 /oe put
dup 157 /bullet put
dup 158 /zcaron put
dup 159 /Ydieresis put
dup 160 /space put
dup 161 /exclamdown put
dup 162 /cent put
dup 163 /sterling put
dup 164 /currency put
dup 165 /yen put
dup 166 /brokenbar put
dup 167 /section put
dup 168 /dieresis put
dup 169 /copyright put
dup 170 /ordfeminine put
dup 171 /guillemotleft put
dup 172 /logicalnot put
dup 173 /hyphen put
dup 174 /registered put
dup 175 /macron put
dup 176 /degree put
dup 177 /plusminus put
dup 178 /twosuperior put
dup 179 /threesuperior put
dup 180 /acute put
dup 181 /mu put
dup 182 /paragraph put
dup 183 /periodcentered put
dup 184 /cedilla put
dup 185 /onesuperior put
dup 186 /ordmasculine put
dup 187 /guillemotright put
dup 188 /onequarter put
dup 189 /onehalf put
dup 190 /threequarters put
dup 191 /questiondown put
dup 192 /Agrave put
dup 193 /Aacute put
dup 194 /Acircumflex put
dup 195 /Atilde put
dup 196 /Adieresis put
dup 197 /Aring put
dup 198 /AE put
dup 199 /Ccedilla put
dup 200 /Egrave put
dup 201 /Eacute put
dup 202 /Ecircumflex put
dup 203 /Edieresis put
dup 204 /Igrave put
dup 205 /Iacute put
dup 206 /Icircumflex put
dup 207 /Idieresis put
dup 208 /Eth put
dup 209 /Ntilde put
dup 210 /Ograve put
dup 211 /Oacute put
dup 212 /Ocircumflex put
dup 213 /Otilde put
dup 214 /Odieresis put
dup 215 /multiply put
dup 216 /Oslash put
dup 217 /Ugrave put
dup 218 /Uacute put
dup 219 /Ucircumflex put
dup 220 /Udieresis put
dup 221 /Yacute put
dup 222 /Thorn put
dup 223 /germandbls put
dup 224 /agrave put
dup 225 /aacute put
dup 226 /acircumflex put
dup 227 /atilde put
dup 228 /adieresis put
dup 229 /aring put
dup 230 /ae put
dup 231 /ccedilla put
dup 232 /egrave put
dup 233 /eacute put
dup 234 /ecircumflex put
dup 235 /edieresis put
dup 236 /igrave put
dup 237 /iacute put
dup 238 /icircumflex put
dup 239 /idieresis put
dup 240 /eth put
dup 241 /ntilde put
dup 242 /ograve put
dup 243 /oacute put
dup 244 /ocircumflex put
dup 245 /otilde put
dup 246 /odieresis put
dup 247 /divide put
dup 248 /oslash put
dup 249 /ugrave put
dup 250 /uacute put
dup 251 /ucircumflex put
dup 252 /udieresis put
dup 253 /yacute put
dup 254 /thorn put
dup 255 /ydieresis put
readonly def
/CharStrings 256 dict dup begin
/.notdef 0 def
/r 396 def
/d 282 def
/M 68 def
/A 4 def
/quotedbl 919 def
/exclam 842 def
end readonly def
/sfnts [
  • The EPS file is too long to include it in the body here. If needed any suggestions how to deliver it? – idkfa Apr 10 at 15:47
  • Do you know if the file created by powerpoint is just a bitmap? If so, psfrag won't magically work just because you converted the bitmap to eps. And you can do such pictures easily with e.g. TikZ. – user121799 Apr 10 at 15:49
  • @DavidCarlisle yes it contains (A) marmot yes I know I could use tikz. I'm actually asking for a friend who is not that tech savy and the images tend to get more complex. So I tried to adapt to her workflow. At this point it's bugging me that I cannot figure it out. How can I check if a bitmap is created? That the eps file is rather long for such a simple image baffled me too. – idkfa Apr 10 at 15:57
  • An eps file is (if still vector graphics and not bitmap) just a text file. You can open it in texmaker, and then look for the string David mentions. I'm not sure PowerPoint makes vector graphics, but I'm hopefully wrong – daleif Apr 10 at 15:58
  • 1
    you could try the same fix, just edit the eps replacing (A) [10.422 0] Tj by (A) show – David Carlisle Apr 10 at 16:19
1

The Tj operator (which will be defined in the EPS header) is implementing the PDF operator of the same name, and probably is defined in terms of xshow (which shows a PostScript string while applying inter-letter kerning). As noted in an earlier answer psfrag never overloaded xshow so you can simplify the code by replacing it by show or directly replace

(A) [10.422 0] Tj

by

(A) show

So that psfrag's overloading of show takes effect.

(It is all a very long time ago, but I can't see why psfrag could not overload xshow defining it to ignore the array and just treat the string as it treats the string argument of show, which would save manually editing the EPS file.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.