[{"data":1,"prerenderedAt":139},["ShallowReactive",2],{"blog-post-pandoc-convert-epub-to-pdf":3,"recent-posts":95},{"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},"avmFWREAACgAkXJy","pandoc-convert-epub-to-pdf",null,"blog_posts","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=av979xIAACoAE1AJ&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avmFWREAACgAkXJy%22%29+%5D%5D",[],"2026-11-19T22:45:10+0000",[12],"pandoc-how-to-convert-epub-to-pdf",[],"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 EPUB to PDF",[],"ltr","2026-11-19",[25],{"type":26,"text":27,"spans":28,"direction":22},"heading2","Learn how to convert an EPUB file to PDF using Pandoc and Typst",[],{"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\u002FzHtmOvgGFqs9GTF1_pandoc-convert-epub-to-pdf.png?auto=format,compress","zHtmOvgGFqs9GTF1",{"x":36,"y":36,"zoom":37,"background":38},0,1,"transparent",[40,44,48,52,55,58,61,64,67,70,73,76,79,82,85,88,92],{"type":41,"text":42,"spans":43,"direction":22},"heading3","Install Pandoc and Typst",[],{"type":45,"text":46,"spans":47,"direction":22},"paragraph","Before we start, make sure you have Homebrew installed on your computer and your EPUB file ready in a folder. Install both tools with this command:",[],{"type":49,"text":50,"spans":51,"direction":22},"preformatted","brew install pandoc typst",[],{"type":41,"text":53,"spans":54,"direction":22},"Convert the EPUB to PDF",[],{"type":45,"text":56,"spans":57,"direction":22},"First, open your terminal and navigate to the folder containing your EPUB file. To convert it to a PDF, run this command:",[],{"type":49,"text":59,"spans":60,"direction":22},"pandoc input.epub --pdf-engine=typst -o output.pdf",[],{"type":45,"text":62,"spans":63,"direction":22},"Just swap \u003Ccode>input.epub\u003C\u002Fcode> with your actual filename, and \u003Ccode>output.pdf\u003C\u002Fcode> with the name you want for your PDF. The \u003Ccode>--pdf-engine=typst\u003C\u002Fcode> flag tells Pandoc to build the PDF with Typst. If your book has images, add \u003Ccode>--extract-media=.\u002Fmedia\u003C\u002Fcode> so Pandoc unpacks them into a folder first.",[],{"type":41,"text":65,"spans":66,"direction":22},"Fix the Broken Link Error",[],{"type":45,"text":68,"spans":69,"direction":22},"Some EPUB files include a broken link in their table of contents, and Typst stops with \u003Ccode>label does not exist in the document\u003C\u002Fcode> and the name \u003Ccode>nav.xhtml_toc\u003C\u002Fcode>. To get around it, convert the EPUB to a Typst file first:",[],{"type":49,"text":71,"spans":72,"direction":22},"pandoc input.epub -o book.typ",[],{"type":45,"text":74,"spans":75,"direction":22},"Next, delete the broken link line. On a Mac you can do it with this command, or just open \u003Ccode>book.typ\u003C\u002Fcode> in a text editor and remove the line yourself:",[],{"type":49,"text":77,"spans":78,"direction":22},"sed -i '' '\u002Fnav.xhtml_toc\u002Fd' book.typ",[],{"type":45,"text":80,"spans":81,"direction":22},"Finally, compile it into a PDF:",[],{"type":49,"text":83,"spans":84,"direction":22},"typst compile book.typ book.pdf",[],{"type":45,"text":86,"spans":87,"direction":22},"To make sure everything worked, run \u003Ccode>open book.pdf\u003C\u002Fcode>.",[],{"type":89,"oembed":90},"embed",{"embed_url":91,"type":89},"",{"type":45,"text":93,"spans":94,"direction":22},"One more tip: if Typst complains about a font you asked for, run \u003Ccode>typst fonts\u003C\u002Fcode> to see the exact names installed on your computer.",[],{"results":96,"page":37,"results_per_page":137,"results_size":137,"total_results_size":138,"total_pages":37},[97,116,135],{"id":98,"uid":99,"url":6,"type":7,"href":100,"tags":101,"first_publication_date":10,"last_publication_date":10,"slugs":102,"linked_documents":104,"lang":14,"alternate_languages":105,"data":106},"avmFXBEAAC0AkXKG","pandoc-convert-csv-to-markdown","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=av979xIAACoAE1AJ&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avmFXBEAAC0AkXKG%22%29+%5D%5D",[],[103],"pandoc-how-to-convert-csv-to-markdown",[],[],{"image":107,"title":113},{"dimensions":108,"alt":109,"copyright":6,"url":110,"id":111,"edit":112},{"width":31,"height":32},"Pandoc: How to Convert CSV to Markdown","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FdDE2zaQ1nNI4pvFb_pandoc-convert-csv-to-markdown.png?auto=format,compress","dDE2zaQ1nNI4pvFb",{"x":36,"y":36,"zoom":37,"background":38},[114],{"type":19,"text":109,"spans":115,"direction":22},[],{"id":117,"uid":118,"url":6,"type":7,"href":119,"tags":120,"first_publication_date":10,"last_publication_date":10,"slugs":121,"linked_documents":123,"lang":14,"alternate_languages":124,"data":125},"aviRYBEAACkAkBYS","pandoc-convert-html-to-markdown","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=av979xIAACoAE1AJ&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22aviRYBEAACkAkBYS%22%29+%5D%5D",[],[122],"pandoc-how-to-convert-html-to-markdown",[],[],{"image":126,"title":132},{"dimensions":127,"alt":128,"copyright":6,"url":129,"id":130,"edit":131},{"width":31,"height":32},"Pandoc: How to Convert HTML to Markdown","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F0XaRTeXl-LE8mTSK_pandoc-convert-html-to-markdown.png?auto=format,compress","0XaRTeXl-LE8mTSK",{"x":36,"y":36,"zoom":37,"background":38},[133],{"type":19,"text":128,"spans":134,"direction":22},[],{"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":136},{"image":29,"title":17},3,74,1795128335117]