title: How do I turn off image rendering when converting markdown to PDF with PowerShell?
body: <p>I am converting markdown documents to PDF with Pandoc using PowerShell and want to turn off the image rendering. Is there a way to do this without touching the Markdown itself?</p>
  <p>The Markdown documents are mainly for use on SharePoint, but I do also want to be able to convert them to DOCX and PDF.</p>
  <p>The images in the Markdown therefore link to locations on SharePoint, so Pandoc cannot access them. The images themselves aren't important in the converted documents, since it is the rest of the content that needs to reviewed/archived.</p>
  <p>When I run my DOCX conversion, all documents convert well enough, and where there are images, the 'missing image' box appears. This is fine.</p>
  <p>When I run my PDF conversion in PowerShell:</p>
  <pre><code>gci -r -i *.md | foreach{$pdf=$_.directoryname+&quot;\&quot;+$_.basename+&quot;.pdf&quot;
  ; pandoc --pdf-engine=xelatex -f markdown -s $_.name -o $pdf}
  ; mkdir .\pdf
  ; gci -r -i *.pdf | foreach{$pdf=$_.directoryname+&quot;\&quot;+$_.basename+&quot;.pdf&quot;
  ; move-item $pdf .\pdf\}
  </code></pre>
  <p>Actual Result: This prevents the entire PDF for this file from being converted. PDFs without these images convert nicely.</p>
  <p>For each Image I get the error:</p>
  <blockquote>
  <p>Could not convert image</p>
  <p>'C:/Users/xxx/AppData/Local/Temp/tex2pdf.-yyy/zzz.vs': Cannot load file</p>
  <p>Jpeg not enough bytes</p>
  <p>PNG, Bitmap, Gif, HDR, Tiff, TGA not enough bytes</p>
  <p>Error producing PDF.</p>
  <p>! LaTeX Error: Cannot determine size of graphic in C://Users/xxx/AppData/Loc
  al/Temp/tex2pdf.-yyy/zzz.vs (no BoundingBox).</p>
  </blockquote>
  <p>The Error says I should 'Try running pandoc with --pdf-engine=xelatex.'.
  I get the same result (I have included how I used this addition in the example above)</p>
  <p>Ideally, the output in the PDF would show where the image would be if it were there, or that line would simply not be displayed.</p>
  <p>I was thinking if there were some code I could put around the image links that doesn't display in SharePoint, but does stop any errors in Pandoc, that could be ideal; or, if there was a way to shut down all image rendering in the PowerShell script, that might also be an idea.</p>
  <p>Many thanks in advance for any ideas you may have!</p>