Philip-Scott/Notes-up

Empty PDF file sometimes get's created

Closed this issue · 27 comments

Hello, when i try to export the markdown file to pdf it only creates a file of zero bytes
captura de pantalla de 2016-02-29 21 51 13

Ok, can confirm that trying to generate the file from the editor will not work, for now while i fix it, try to export from the view window :)

Thank you for reporting it! 👍

@igomezal Or can you confirm it happening?

No matter the windows you I use it always generates a file of 0 bytes.

Thanks for your hard work.

@igomezal If you try to open the app from the terminal, and try to export to pdf, does the terminal output any error messages?

I downloaded a virtual machine with Freya, and i can't reproduce it.... :P

When I open notes-up this is what it prints in my terminal:
ivan@ivan-Notebook:~$ notes-up

(Notes:3290): Gtk-CRITICAL **: gtk_window_set_focus: assertion 'gtk_widget_get_can_focus (focus)' failed

But when i press export to pdf it doesn't print anything.

From a web browser, try to print a website. But at the print dialog, sellect "print to file" or "to pdf" pr somethjng along the lines.

Does that work?

How it works on my app is that I first create an empty file, and then I send that to the system's printer as if that was the printing location.

What os, version, and that do you have?

I have just tried it and from the browser it works fine.
And I am using elementary OS 0.3.2 Freya 32-bit.

I'm re-opening this due to it's original bug. I got another bug report about it

I think it's due to FileManager.vala, l110 :
write_file (file, "");

the second argument is content, so with an empty string, the pdf is empty, isn't it ?

@Psylock The write_file (file, "") is just to make an empty file Webkit's printer is going to use... But you just made me think of something! The problem might be that it's taking a bit longer to make the file and to load the page's contest so by the time it get's to the bottom it still isn't loaded.

Can you reproduce the problem consistently?

Every time i export for pdf, i got a 0 bite file.

same result :'(

`
** (Notes:10835): CRITICAL **: enotes_viewer_load_page: assertion 'page != NULL' failed

(Notes:10835): Gtk-CRITICAL **: gtk_window_set_focus: assertion 'gtk_widget_get_can_focus (focus)' failed
Printing...

`

Maybe you should add a warning when no note has been selected ? (i've tried both cases, both failed)

Can you try it again? I got rid of that create empty file thing

So if the printing is failing, then nothing will be shown

Still 0 bytes. Still "Printing..". message also.

JO0st commented

To me it is still happining in version 1.3

Install Notes-up 1.3 from Loki 0.4.1 from AppCenter.
Not worked export to PDF. Created file in Zerro byte size.
Please fix this very important functions.

I'm having the same issue. Always getting the 0 bytes file when exporting to PDF.

@marcos-90 Please tell me more about your system. Such as what language are you using :)

Also, can you run apt-cache policy libwebkit2gtk-4.0-dev and apt-cache policy libwebkit2gtk-3.0-25 and post here the full output? Thanks

Sadly, i've never being able to reproduce so i can't fix it :(

@marcos-90 sorry, apt-cache policy libwebkit2gtk-4.0-37 as well :)

Ok! (that was fast!! :) )

I'm using elementary os, 0.4.1, Loki in Spanish (Latin America). The only difference is that I installed the latest stable kernel in the ubuntu repos. I'm using kernel 4.11.2-041102-generic. I didn't change the repos or anything like that, i downloaded the kernel packages and installed them.

I installed the app using the AppCenter.

libwebkit2gtk-4.0-dev:
Instalados: (ninguno)
Candidato: 2.16.3-0ubuntu0.16.04.1
Tabla de versión:
2.16.3-0ubuntu0.16.04.1 500
500 http://ar.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
2.10.9-1ubuntu1 500
500 http://ar.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

libwebkit2gtk-3.0-25:
Instalados: (ninguno)
Candidato: 2.4.11-0ubuntu0.1
Tabla de versión:
2.4.11-0ubuntu0.1 500
500 http://ar.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
2.4.10-0ubuntu1 500
500 http://ar.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

libwebkit2gtk-4.0-37:
Instalados: 2.16.3-0ubuntu0.16.04.1
Candidato: 2.16.3-0ubuntu0.16.04.1
Tabla de versión:
*** 2.16.3-0ubuntu0.16.04.1 500
500 http://ar.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
100 /var/lib/dpkg/status
2.10.9-1ubuntu1 500
500 http://ar.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

Hey! There we go! :D I'm finally able to reproduce it! Looks like non-English languages break "printing" on the app

@everyone I was able to get it fixed in Spanish. Sadly, this requires translating a line of text

000b358#diff-9427b2497682f9189e9ffae2687f88bfR42

If anyone can help doing the translations of this line like on the link above, you'll be able to fix it for everyone on your language!

You can get the correct text for your language on the printing dialog like so:
captura realizada el 2017-07-09 13 14 15

For me i'ts working perfectly now! Great work! :D

I don't know much about coding, but I'll try to help with the things I can.

I'm closing this since the fix is out.

@Philip-Scott would it not be possible to have the string inherit whatever it's translated as in the webkit repo?
What about changing the export to pdf button to print or export PDF? That way there is more utility too!