[{"data":1,"prerenderedAt":127},["ShallowReactive",2],{"blog-post-pandoc-convert-pdf-to-markdown":3,"recent-posts":83},{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":10,"slugs":11,"linked_documents":13,"lang":14,"alternate_languages":15,"data":16},"avh2CREAACsAj-6V","pandoc-convert-pdf-to-markdown",null,"blog_posts","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=av4qlxYAACwAwP4a&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avh2CREAACsAj-6V%22%29+%5D%5D",[],"2026-11-18T22:45:43+0000",[12],"pandoc-how-to-convert-pdf-to-markdown",[],"en-us",[],{"title":17,"date":23,"description":24,"image":29,"content":39},[18],{"type":19,"text":20,"spans":21,"direction":22},"heading1","Pandoc: How to Convert PDF to Markdown",[],"ltr","2026-11-18",[25],{"type":26,"text":27,"spans":28,"direction":22},"heading2","Learn how to convert a PDF to Markdown using Pandoc & pdftotext",[],{"dimensions":30,"alt":20,"copyright":6,"url":33,"id":34,"edit":35},{"width":31,"height":32},1280,720,"https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F-p25dHHmH8oerC6a_pandoc-convert-pdf-to-markdown.png?auto=format,compress","-p25dHHmH8oerC6a",{"x":36,"y":36,"zoom":37,"background":38},0,1,"transparent",[40,44,48,52,55,58,61,64,67,70,73,76,80],{"type":41,"text":42,"spans":43,"direction":22},"heading3","Install Pandoc and Poppler",[],{"type":45,"text":46,"spans":47,"direction":22},"paragraph","Before we start, make sure you have Homebrew installed on your computer and a PDF file ready in a folder. Pandoc can't read PDF files directly, so we'll also need Poppler, which gives us a tool called \u003Ccode>pdftotext\u003C\u002Fcode>. Install both with this command:",[],{"type":49,"text":50,"spans":51,"direction":22},"preformatted","brew install pandoc poppler",[],{"type":41,"text":53,"spans":54,"direction":22},"Extract the Text",[],{"type":45,"text":56,"spans":57,"direction":22},"First, open your terminal and navigate to the folder that has your PDF. If you try to convert it straight away with \u003Ccode>pandoc input.pdf -o output.md\u003C\u002Fcode>, Pandoc replies with \u003Ccode>Pandoc can convert to PDF, but not from PDF\u003C\u002Fcode>. So let's pull the text out first by running this command:",[],{"type":49,"text":59,"spans":60,"direction":22},"pdftotext -layout input.pdf output.txt",[],{"type":45,"text":62,"spans":63,"direction":22},"Just remember to replace \u003Ccode>input.pdf\u003C\u002Fcode> with your actual filename. The \u003Ccode>-layout\u003C\u002Fcode> flag keeps the original spacing of the text.",[],{"type":41,"text":65,"spans":66,"direction":22},"Convert to Markdown",[],{"type":45,"text":68,"spans":69,"direction":22},"Now hand that text file to Pandoc:",[],{"type":49,"text":71,"spans":72,"direction":22},"pandoc output.txt -o output.md",[],{"type":45,"text":74,"spans":75,"direction":22},"This finishes almost instantly. To make sure everything worked, run \u003Ccode>head -5 output.md\u003C\u002Fcode> to see the first five lines of your new Markdown file. Keep in mind that a PDF has no real headings, so you may need to tidy up the Markdown by hand.",[],{"type":77,"oembed":78},"embed",{"embed_url":79,"type":77},"",{"type":45,"text":81,"spans":82,"direction":22},"Pandoc wraps long lines by default. If you want each paragraph on a single line, just add \u003Ccode>--wrap=none\u003C\u002Fcode> to your \u003Ccode>pandoc\u003C\u002Fcode> command.",[],{"results":84,"page":37,"results_per_page":125,"results_size":125,"total_results_size":126,"total_pages":37},[85,87,106],{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":10,"slugs":11,"linked_documents":13,"lang":14,"alternate_languages":15,"data":86},{"image":29,"title":17},{"id":88,"uid":89,"url":6,"type":7,"href":90,"tags":91,"first_publication_date":10,"last_publication_date":10,"slugs":92,"linked_documents":94,"lang":14,"alternate_languages":95,"data":96},"avh2BREAACsAj-57","sox-trim-audio","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=av4qlxYAACwAwP4a&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avh2BREAACsAj-57%22%29+%5D%5D",[],[93],"sox-how-to-trim-audio",[],[],{"image":97,"title":103},{"dimensions":98,"alt":99,"copyright":6,"url":100,"id":101,"edit":102},{"width":31,"height":32},"SoX: How to Trim Audio","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FuxvNV-Rsgm5-5KyY_sox-trim-audio.png?auto=format,compress","uxvNV-Rsgm5-5KyY",{"x":36,"y":36,"zoom":37,"background":38},[104],{"type":19,"text":99,"spans":105,"direction":22},[],{"id":107,"uid":108,"url":6,"type":7,"href":109,"tags":110,"first_publication_date":10,"last_publication_date":10,"slugs":111,"linked_documents":113,"lang":14,"alternate_languages":114,"data":115},"avh2BxEAACcAj-6H","sox-fix-unsupported-audio-format","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=av4qlxYAACwAwP4a&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avh2BxEAACcAj-6H%22%29+%5D%5D",[],[112],"sox-how-to-fix-unsupported-audio-format",[],[],{"image":116,"title":122},{"dimensions":117,"alt":118,"copyright":6,"url":119,"id":120,"edit":121},{"width":31,"height":32},"SoX: How to Fix Unsupported Audio Format","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FWi9VtwU58Nuu2b8Q_sox-fix-unsupported-audio-format.png?auto=format,compress","Wi9VtwU58Nuu2b8Q",{"x":36,"y":36,"zoom":37,"background":38},[123],{"type":19,"text":118,"spans":124,"direction":22},[],3,69,1795041965065]