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

0.32.0 - Question about "Removed CLI block on .exe installs..." #2215

Closed
Info-BC opened this issue Nov 12, 2024 · 20 comments
Closed

0.32.0 - Question about "Removed CLI block on .exe installs..." #2215

Info-BC opened this issue Nov 12, 2024 · 20 comments
Labels
question Further information is requested

Comments

@Info-BC
Copy link

Info-BC commented Nov 12, 2024

Hello,

Regarding 0.32.0 Major Enhancements : Removed CLI block on .exe installs to instead use dependency detection allowing Windows users to use CLI programs if installed

Does this mean, for Windows Stirling-PDF.exe release users (or with-login), that we can now install for example OCRMyPDF and LibreOffice in order to have missing function like compress PDF and convert PDF from or to DOCX, etc. ?

Thanks

@dosubot dosubot bot added the question Further information is requested label Nov 12, 2024
Copy link

dosubot bot commented Nov 12, 2024

Hello, @Info-BC! I'm here to help you with any questions or issues you may have. Let's see how I can assist you.

The update in version 0.32.0, which removed the CLI block on .exe installs, allows Windows users to use CLI programs like OCRMyPDF and LibreOffice if they are installed. This means you can indeed install these tools to enable functionalities such as compressing PDFs and converting PDFs to or from DOCX. The dependency detection on Windows is handled by using the where command to check if a command is available, which is part of the ExternalAppDepConfig class [1].

To continue talking to Dosu, mention @dosu.

@Frooodle
Copy link
Member

Correct!

@Info-BC
Copy link
Author

Info-BC commented Nov 12, 2024

Ok, so I started with my first missing dependency Ghostscript, I installed the last release Ghostscript 10.04.0 for Windows (64 bit) from the official website, it's in the Windows path as I can run gswin64 in a cmd prompt from any directory.

But after launching Stirling-PDF.exe, in the cmd log I still have the warning for missing GhostScript. Could-you tell me if I have to do another thing?

Thanks

@Frooodle
Copy link
Member

It is checking for it to be called gs not gswin
It might need different naming for windows
This is quite a new usecase for us so might be bugs

If that is the case we can work a fix into next patch

@Info-BC
Copy link
Author

Info-BC commented Nov 12, 2024

To check, I made a copy of the file from C:\Program Files\gs\gs10.04.0\bin\gswin64.exe to C:\Program Files\gs\gs10.04.0\bin\gs.exe - And I don't see the log warning now, I don't know if the exe copy could cause other problems?

I continue with Libreoffice

@Frooodle
Copy link
Member

Thanks for checking
I have created
#2216
To address gs naming, let me know for the others!

@Info-BC
Copy link
Author

Info-BC commented Nov 12, 2024

After Libreoffice installed, I had to add C:\Program Files\LibreOffice\program to system's path environment variable, now I have convert from PDF menu, tried a pdf->doc and it's ok.

@Info-BC
Copy link
Author

Info-BC commented Nov 12, 2024

Then for OCRmyPDF, I installed last release of Phyton (there is a tick at the beginning to add to path) and Tesseract (with french as additionnal language) + pip install ocrmypdf

I have the menu for OCR but I can't use it for now, as I am using french, it's written I have to check the documentation to use OCR with other languages or outside Docker.

@Info-BC
Copy link
Author

Info-BC commented Nov 12, 2024

Compress PDF is now also available and works

@Info-BC
Copy link
Author

Info-BC commented Nov 12, 2024

For unoconv, I have downloaded the source, placed on C:\unoconv-0.8.2 and added to the system path variable. No warning anymore, I have the menu File to PDF, but I tried and had error : Error:java.io.IOException: Cannot run program "unoconv": CreateProcess error=2, file missing

For OCRmyPDF, I read the docs but can't find how to make it work, I have the eng + additionnal fr language file at the right place I guess C:\Program Files\Tesseract-OCR\tessdata and added C:\Program Files\Tesseract-OCR in the path but still only the message to check docs (no form for file input and options)

@Info-BC
Copy link
Author

Info-BC commented Nov 12, 2024

For OpenCV, I installed with pip install opencv-python but I still have the warning.

I've just seen that I have 2 python installations because libreoffice has one built-in and I installed another separatly. The first one does not have pip, only the other. So maybe there is something to do with that...

If I launch python.exe from cmd it is the one of libreoffice, via the path system variable. The python installation added to the user path variable ...\Python313\ and ...\Python313\Scripts\ folders

@Ludy87
Copy link
Contributor

Ludy87 commented Nov 13, 2024

For OCRmyPDF, I read the docs but can't find how to make it work, I have the eng + additionnal fr language file at the right place I guess C:\Program Files\Tesseract-OCR\tessdata and added C:\Program Files\Tesseract-OCR in the path but still only the message to check docs (no form for file input and options)

Did you also specify the path in the settings.yml?

system:
  tessdataDir: C:\\Program Files\\Tesseract-OCR\\tessdata

@Info-BC
Copy link
Author

Info-BC commented Nov 13, 2024

Thank you! I modified the path in ...\StirlingPDF\configs\settings.yml and now it works, I have both eng and fr languages.

@Frooodle
Copy link
Member

So to confirm does all above work without issue other than gswin64 needing changing to gs?

@Frooodle
Copy link
Member

Frooodle commented Nov 13, 2024

we need to add all this info of what you did to
https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Getting%20started/Installation/Local/Windows.md
to get it published on our website etc
Would be a big help if you could write some of that down in a PR to above file to help others

@Info-BC
Copy link
Author

Info-BC commented Nov 13, 2024

So to confirm does all above work without issue other than gswin64 needing changing to gs?

These does not work yet :

For unoconv, I have downloaded the source, placed on C:\unoconv-0.8.2 and added to the system path variable. No warning anymore, I have the menu File to PDF, but I tried and had error : Error:java.io.IOException: Cannot run program "unoconv": CreateProcess error=2, file missing

For OpenCV, I installed with pip install opencv-python but I still have the warning.

The two python as mentionned above may be a problem, but I don't know what could be the best way to solve it?

I haven't tested these for now :

Weasyprint​ (found the Windows release but there is some other things to install as I could see)
pdftohtml (Could-you tell me where to find this one?)

@Info-BC
Copy link
Author

Info-BC commented Nov 13, 2024

we need to add all this info of what you did to https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Getting%20started/Installation/Local/Windows.md to get it published on our website etc Would be a big help if you could write some of that down in a PR to above file to help others

Yes, when everything will be running well, I would be happy to write the steps

@Info-BC
Copy link
Author

Info-BC commented Nov 20, 2024

For weasyprint, I downloaded the last release, put weasyprint.exe in c:\weasyprint\ which I added to the path (be sure to check with your av software, my avira took it down in quarantine..!) No more warning and it works, tested with url to pdf.

@Info-BC
Copy link
Author

Info-BC commented Nov 20, 2024

For pdftohtml, I found the exe on https://sourceforge.net/projects/pdftohtml/

Same steps, c:\pdftohtml\pdftohtml.exe + in the path, then no warning and it works

But there is some errors in the cmd log concerning ghostscript, it search for 'gswin32c' so can't find it (I only have x64 version for the moment) and write 'Failed to launch Ghostscript !'

Now running 0.33.1 by the way..!

@Frooodle
Copy link
Member

Frooodle commented Dec 3, 2024

https://docs.stirlingpdf.com/Getting%20started/Installation/Local/Windows%20Installation/

added some instructions here, also have changed some things recently OCRMyPDF is not longer used only tesseract itself

gs is replaced by qpdf

@Frooodle Frooodle closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants