Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporters are not working. #304

Open
mobinmob opened this issue Apr 7, 2020 · 11 comments
Open

Exporters are not working. #304

mobinmob opened this issue Apr 7, 2020 · 11 comments
Labels

Comments

@mobinmob
Copy link

mobinmob commented Apr 7, 2020

I am trying to update Marker in void linux ( void-linux/void-packages#20727 ) and I can only export to html and latex. Every other exporter is not producing a file. I have the same problem with the flatpak.

@fabiocolacio
Copy link
Owner

fabiocolacio commented Apr 7, 2020

Hi @mobinmob, for formats other than HTML, latex and PDF, Marker uses the pandoc command to export. If pandoc is missing on the host, most of the formats won't work.

I can confirm that it pandoc is missing from the flatpak version (I will work on fixing that). On bare metal, make sure pandoc is installed and try again.

PDF export should work even without pandoc though, so if you are still experiencing problems with that, let me know (I haven't had issues with PDF export so far).

@mobinmob
Copy link
Author

mobinmob commented Apr 7, 2020

Pandoc is installed in my system. Both my package and flatpak exhibit similar behavior unfortunately. I expected problems with my build, but not with the flatpak (I am primarily using flatpaks for proprietary programs with no issues).
If I try to export to pdf I get:
print failed with error: ?????? ?????????????? ??????????????????
From both my package and the flatpak.
If I try to export to docx I get:
sh: 1: Syntax error: "(" unexpected from my package and

sh: -c: ?????? 0: ?????????? ?????? ????? ??? ?? ??????????? ??????? <<(>>
sh: -c: ?????? 0: `pandoc -s -c Solarized (Dark).css -o /path/to/test .marker_tmp_markdown.md'

from the flatpak.

The flatpak has an extra warning:
Can't open portal file chooser: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.portal.Desktop was not provided by any .service files

The errors above appear if I run the program from cli (bash, with LANG=C).

@fabiocolacio
Copy link
Owner

fabiocolacio commented Apr 7, 2020

Regarding the PDF issue, I haven't encountered that yet but I'll investigate it more. If you have access to a printer, you might try printing a document to see if that works (or simply opening the print dialog and printing to a pdf) to see if you can get errors or info from that. Under the hood PDF generation is done by printing the html view to a pdf.

The syntax error is because the css file Solarized (Dark).css should be wrapped in quotes, so I'll need to fix that. That is also supposed to be a full path to the sheet instead of just the file name, so I suspect it would run into an error regardless of that. I'll work on fixing the pandoc issues and update here with my results.

I'm no flatpak expert but the portal issue sounds like it could be from running an older version of flatpak (just spitballing)? Does the filechooser work properly for the marker flatpak for you when opening/saving/exporting files?

@mobinmob
Copy link
Author

mobinmob commented Apr 7, 2020

Regarding the PDF issue, I haven't encountered that yet but I'll investigate it more. If you have access to a printer, you might try printing a document to see if that works (or simply opening the print dialog and printing to a pdf) to see if you can get errors or info from that. Under the hood PDF generation is done by printing the html view to a pdf.

Printing to a pdf file works for both my package and the flatpak.

The syntax error is because the css file Solarized (Dark).css should be wrapped in quotes, so I'll need to fix that. That is also supposed to be a full path to the sheet instead of just the file name, so I suspect it would run into an error regardless of that. I'll work on fixing the pandoc issues and update here with my results.

Thank you! I am using Marker a lot, but I have not tried exporting to formats other than html until yesterday. I tried them because we attempted to package without the included mathjax (since the in-program preview and the html export seem to work without it).

I'm no flatpak expert but the portal issue sounds like it could be from running an older version of flatpak (just spitballing)? Does the filechooser work properly for the marker flatpak for you when opening/saving/exporting files?

i am running the latest stable release of flatpak (1.6.3). The filechooser does not appear for opening or saving files but it does for exporting.

@Gusser93
Copy link

I'm having the same problem on an arch linux system with version 2020.04.04. Could this be a problem with the locale? Here

gtk_print_settings_set(print_s, GTK_PRINT_SETTINGS_PRINTER, "Print to File");

the name for the printer is "Print to File". On a German system it's called "In Datei drucken". I'm able to export the pdf with the printer dialog without problems.

I found a similar issue in the Tor issue tracker. Maybe the problem stated in the patch applies here too?

@BastienBalaud
Copy link

BastienBalaud commented Jun 5, 2020

Hello,

I have encounter similar issue with PDF printing with Gnome in French :

marker
scroll 2.0 extension initialized
scroll 2.0 extension initialized
print failed with error: Imprimante non trouvée

But when when I switch to English, it's works fine

export LANGUAGE=en_GB
marker
scroll 2.0 extension initialized
scroll 2.0 extension initialized

@fabiocolacio
Copy link
Owner

fabiocolacio commented Jul 17, 2020

Thanks for the input about the PDF export. GtkPrintSettings has no programmatic way to select "Print to File" as a target (other than using a string). It seems there are a few ways we can fix this:

  1. Provide translations for the string (but there will always be languages that are left out)
  2. Export to PDF through pandoc, but then there is an added requirement on a bloated LaTeX install, and the PDF styling won't match webview's styling
  3. Remove PDF from the export page and hope users are saavy enough to know to go to the print menu and select Print to File themselves.

As much as I think it is not user-friendly, I think option 3 is the way to go. I am really not keen on including a full LaTeX distribution in the package, and option 1 is only a partial fix :/

@fabiocolacio fabiocolacio pinned this issue Jul 17, 2020
@fabiocolacio
Copy link
Owner

fabiocolacio commented Jul 25, 2020

The PDF issue seems to be fixed with #321. Feel free to re-open if it isn't fixed for you all (has not been pushed to flatpak yet), so you must build from source).

@ghost
Copy link

ghost commented Sep 21, 2020

Hi !
Try #321 patch with the latest zip release.
It works ... But if you try to add some charter plots, it fails again with the "no printer detected" message.

City-busz added a commit to City-busz/charter that referenced this issue Jun 5, 2021
Leaving locale as C breaks PDF export in Marker:
fabiocolacio/Marker#304 (comment)
City-busz added a commit to City-busz/charter that referenced this issue Jun 5, 2021
It's enough to set the decimal-point character to the default locale. Also reset locale after rendering. Leaving locale as C breaks PDF export in Marker:
fabiocolacio/Marker#304 (comment)
@nick87720z
Copy link
Contributor

nick87720z commented Dec 3, 2021

This seems to be fixed in latest git.
If I rename pandoc command to e.g. pandoc_, all but HTML, PDF and LATEX is hidden in export menu.

@violetmage
Copy link

violetmage commented Apr 15, 2022

pdfs are overrated anyway ;)

@fabiocolacio close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants