mb21 / panwriter

Markdown editor with pandoc integration and paginated preview.
https://PanWriter.com
GNU General Public License v3.0
1.03k stars 49 forks source link

Make PDF searchable and convert headings to bookmarks #34

Closed mike-lowski closed 3 years ago

mike-lowski commented 3 years ago

Printing to PDF for some reason converts them as a scan without searchable functions nor bookmarks. Would be nice to have them convert with these features (like it does exporting to pdflatex).

Thanks for your awesome work!

mb21 commented 3 years ago

Interesting... what's your operating system and version?

If you have pdflatex and pandoc installed, you can also do File -> Export and choose PDF in the dropdown. Depending on your needs you can also set the pdf-format YAML metadata key to html, context or anything else pandoc supports for converting to PDF... see https://github.com/mb21/panwriter#export-via-pandoc

mike-lowski commented 3 years ago

Windows 10, I have pdlatex and pandoc installed. Exporting to pdflatex generates the file with these features, but of course in a latex template. I tried changing the pdf-format to html but for some reason PanWriter doesn't do anything (I have wkhtmltopdf installed too).

mb21 commented 3 years ago

but for some reason PanWriter doesn't find wkhtmltopdf

can you post the output message in the dialog? what happens if you execute pandoc -t html etc. directly in a command prompt? What pandoc version have you installed?

mb21 commented 3 years ago

I just tried on macOS, and after I saved my markdown file, wkhtmltopdf export worked... (exporting from an unsaved file gave me a permissions error... that's probably something I could code a better error message for...)

mike-lowski commented 3 years ago

When running pandoc -t html nothing happens in my cmd.

Pandoc is 2.10.1 last update.

I'll keep trying, for sure it's some silly thing.

mb21 commented 3 years ago

sorry I meant the full command, you need to include the paths... so something like:

pandoc --output C:\...\Desktop\test.pdf --to html C:\...\Desktop\yourInputFile.md
mike-lowski commented 3 years ago

Same message: wkhtmltopdf not found.

mb21 commented 3 years ago

then you haven't installed wkhtmltopdf in a way pandoc can find it... what happens if you do:

wkhtmltopdf --version
mike-lowski commented 3 years ago

Not recognized as internal or external command. I have it defined as path in the environment variables.

mb21 commented 3 years ago

I don't know much about Windows, but must be something with your wkhtmltopdf install... see e.g. https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2971