grocy / grocy

ERP beyond your fridge - Grocy is a web-based self-hosted groceries & household management solution for your home
https://grocy.info
MIT License
6.85k stars 568 forks source link

Feature Request: Generate a Shopping List in a PDF which allow selecting text with the mouse #2124

Closed AdrienDSlone closed 1 year ago

AdrienDSlone commented 1 year ago

Hello, sometimes I would like to copy and paste a part of the ingredients from the PDF list but I can't select the text. Instead, when I clic a text, I have a hand mouse and it grab the page.

To reproduce it, I used Sumatra to read the generated Shopping.pdf.

berrnd commented 1 year ago

Your Browser generates a PDF, not grocy - so it's entirely up to your Browser if text is "real text" or maybe a picture in your PDF.

Or it's maybe a simple configuration issue or a limitation of your preferred PDF reader.

I took the time to reproduce that using Firefox:

https://user-images.githubusercontent.com/2161815/216667510-22cb2b8d-93f8-4bfb-9466-132a834fad2d.mp4

And your choosen PDF reader SumatraPDF:

https://user-images.githubusercontent.com/2161815/216667648-6ec208ed-64c9-4de7-834c-1dd46e8bd9ef.mp4

And I can't reproduce that.

In any case, as said, grocy definitely renders / displays text - what your Browser does with that when generating a PDF or how your PDF reader of choice behaves when trying to select text is completely out of control of grocy.

AdrienDSlone commented 1 year ago

Thank you very much for your quick answer :) I wasn't aware of my browser's intern process. I will check why the PDF is delivered as I described and not as yours and update some news here as soon as I found why.

AdrienDSlone commented 1 year ago

My PDF exported with firefox (109.0.1) works fine thanks to docker-composer from https://github.com/linuxserver/docker-grocy

I forgot to mention that I was using the desktop app. Since my post, I tried to print my list with few PDF printer . On shopping list screen, I clicked "Print" button, then chose a printer then "print" again.

image

I posted here because I thought it was global, should I open an issue here ? : https://github.com/grocy/grocy-desktop

berrnd commented 1 year ago

with Microsoft Print to PDF, I obtain the issue as described above.

Then that's clearly an issue of Microsoft Print to PDF (more than obviously a well known one, when doing a quick Google search on that topic).

 

with https://github.com/clawsoftware/clawPDF - I can select something inside the pdf but it copies and pastes that "�? !"?#? $?"%???&" On the picture we can see that I can't pick the text but something under it.

Then that's clearly an issue of clawPDF.

 

and with https://github.com/stchan/PdfScribe : I did the same thing with ClawPDF and I also copied this : "!"?#? $?"%???&".

Then that's clearly an issue of PdfScribe.

  Once again: grocy doesn't generate PDFs, it renders a web page (with text!). It's your Browser or your used PDF printer (whyever something like that is still a thing in 2023 where each and every major Browser can generate - obviously better - PDFs themselves).

 

I posted here because I thought it was global, should I open an issue here ? : https://github.com/grocy/grocy-desktop

Feel free to do that, here is the answer you will get from me there: grocy-desktop uses CefSharp as an embedded Browser and has, unlike Chrome itself, no built-in "Save to PDF" functionality in the print dialog. So you can only use such a PDF printer there, if you really need to "print" stuff to PDF and then live with the limitations of the PDF printer of choice.

grocy-desktop is a very simplified and managed "just works" way to run grocy. If you want to have control over every environment detail, it's always better to run the corresponding application yourself.

berrnd commented 1 year ago

By the way: It's of course also possible to use grocy-desktop to run a "grocy server" (if that's really your preferred way of running it) and use any other Browser to access the web frontend - see: https://github.com/grocy/grocy-desktop#external-access

AdrienDSlone commented 1 year ago

Thank you for giving me all the details, I understand now.

As you recommended, I run the grocy-desktop as a server, open its URL in Firefox and printed the list. It's awesome !

For those who want to know where I found the server URL, it's in the bottom of the desktop app on the left corner, after you did that : https://github.com/grocy/grocy-desktop#external-access

berrnd commented 1 year ago

For those who want to know where I found the server URL, it's in the bottom of the desktop app on the left corner

Just like mentioned at exactly the same place: External access Both, grocy and Barcode Buddy (if enabled), can be optionally accessed from external machines, external access can be enabled via File -> Enable external access (please accept the native Windows firewall question accordingly). See the status bar for information about the URLs.