BoostIO / BoostNote-Legacy

This repository is outdated and new Boost Note app is available! We've launched a new Boost Note app which supports real-time collaborative writing. https://github.com/BoostIO/BoostNote-App
Other
17.07k stars 1.47k forks source link

Export error: callback must be a function when exporting to PDF #3262

Open federicochiesa opened 4 years ago

federicochiesa commented 4 years ago

Current behavior

When I try to export a particular note to PDF it gives me the error: export error, callback must be a function, even though it's like all the other notes I have, there's nothing special in it.

Expected behavior

It exports to a PDF file

Steps to reproduce

  1. Open the note
  2. Click the info button
  3. Click pdf and type in a file name
  4. Click Export

Environment

Flexo013 commented 4 years ago

Could you provide us with two Markdown files? One that exports fine and one that causes the problem?

federicochiesa commented 4 years ago

Unfortunately it doesn't let me export it in any format, I just tried .md and it gives me the same error. If you know of a way to get the files to you I'll send them in, no problem.

Flexo013 commented 4 years ago

You could try locating the .cson file in your storage folder. I don't know the location of that folder on macOS. then send us the .cson file of the note you can't export.

federicochiesa commented 4 years ago

https://mega.nz/#!1Y00UQgB!q0iJNLj2lzkqWFwHF5ZNbiGJqfLU7oWq0YYmconjSic This is the link to the cson file.

PandaGab commented 4 years ago

Hi! I also had this exact error, I think it was caused when I dropped in images (dragging). Here is an example of the markdown line when dropping in images: ![example.png](:storage/a336f8ee-2664-4e3e-bff8-77f514b10094/ec164f71.png)

I changed it to the absolute path ![](/path/to/image)

And I was now being able to export my document as a pdf.

username223 commented 4 years ago

Had this exact issue when trying to export a note containing a file that didn't exist.

For some reason, sometimes, when I ctrl+v images into the note the actual file won't be created in the attachments folder. The files will still show up in the preview pane, but on program restart the previews will not be available.

Pasting the images into the note until they are all present fixed this for me (even with the :storage notation).

rebastion commented 4 years ago

Really unfortunate error, no matter if PDF or HTML export. If it is tied to the storage location of images, they should become properly saved and right path included if one were to copy paste images into notes (as I do a lot, too).

The above trick of including absolute paths works only partially. I end up with PDFs that have some images in them, but others not. And in fact, my attachments folders is now completely empty for some reason....

Flexo013 commented 4 years ago

@rebastion @PandaGab We are aware of this and hopefully it will be fixed soon: #2815 If you want to incentivize developers to pick up this issue then consider funding it on IssueHunt.

qrospars commented 4 years ago

A quick workaround is to press Ctrl + S to save the note everytime you import a new image. It usually saves it directly in the attachments folder and you will never have this problem again :)

plastikhub commented 4 years ago

Still having this issue after drag and drop. Any updates?

Flexo013 commented 4 years ago

@plastikhub Could you try to get the image by copy-paste instead an see if that fixes the issue?

ringoma commented 4 years ago

For a quick solution is to "Print" then "Save as PDF" if you have any drag & drop images which you don't want to organize them all again.

infophile commented 4 years ago

I'm using Boostnote 0.16.0 and the problem remains.

To fix it I had :

  1. First to uncheck in the Preferences/Interface the option "Delete attachments, that are not referenced in the text anymore"
  2. Then to replace ":storage" by the full path of the images located in the /path-to-your/Boostnote/attachments/ folder.

Without the first step, as soon as I renamed the path, Boostnote was deleting the image in the attachments folder (which explains what observes @rebastion)