HugoHasenbein / redmine_more_previews

Redmine plugin to preview various file types in redmine's preview pane
https://www.redmine.org/plugins/redmine_more_previews
GNU General Public License v2.0
48 stars 17 forks source link

Bitnami Redmine 5.0.0 for Windows & LibreOffice converter problem - Error. Failed to load pdf document. #82

Open MFurminsky opened 1 year ago

MFurminsky commented 1 year ago

Help me please. The plugin allows you to display pdf files without problems. But, it does not convert doc files to pdf and does not display. From the command line it is possible to convert. >soffice --headless --convert-to pdf d:\test.doc --outdir d:\redmine

Windows 10 x64 LibreOffice_6.0.7.3_Win_x64.msi pandoc-3.1.2-windows-x86_64.msi gs10011w64.exe ImageMagick-7.1.1-11-Q16-HDRI-x64-dll.exe

Provided that a temporary folder has been created, all commands work normally in the cmd environment.

cd "C:/Users/Xalyf/AppData/Local/Temp/d20230607-6360-1ed3wfj" & soffice --headless --convert-to pdf --outdir "C:/Users/Xalyf/AppData/Local/Temp/d20230607-6360-1ed3wfj" "D:/redmine/apps/redmine/htdocs/files/2023/05/230511140318_c9d9f248e83827d81e47f4ccdf7150b6.doc" & move "./230511140318_c9d9f248e83827d81e47f4ccdf7150b6.pdf" "C:/Users/Xalyf/AppData/Local/Temp/d20230607-6360-1ed3wfj/index.pdf"

index.pdf file is generated and available. ____ log file snippet E, [2023-06-07T13:01:48.110649 #6360] ERROR -- : [8770521f-107e-435e-a74a-df1fec068565] Creating preview with Libre failed (pid 12296 exit 1): Command: cd "C:/Users/Xalyf/AppData/Local/Temp/d20230607-6360-1ed3wfj" & soffice --headless --convert-to pdf --outdir "C:/Users/Xalyf/AppData/Local/Temp/d20230607-6360-1ed3wfj" "D:/redmine/apps/redmine/htdocs/files/2023/05/230511140318_c9d9f248e83827d81e47f4ccdf7150b6.doc" & move "./230511140318_c9d9f248e83827d81e47f4ccdf7150b6.pdf" "C:/Users/Xalyf/AppData/Local/Temp/d20230607-6360-1ed3wfj/index.pdf" E, [2023-06-07T13:01:48.112147 #6360] ERROR -- : [8770521f-107e-435e-a74a-df1fec068565] An error occured while generating preview for D:/redmine/apps/redmine/htdocs/files/2023/05/230511140318_c9d9f248e83827d81e47f4ccdf7150b6.doc E, [2023-06-07T13:01:48.112242 #6360] ERROR -- : [8770521f-107e-435e-a74a-df1fec068565] Exception was: RedmineMorePreviews::Exceptions::ConverterShellError E, [2023-06-07T13:01:48.112460 #6360] ERROR -- : [8770521f-107e-435e-a74a-df1fec068565] D:/redmine/apps/redmine/htdocs/plugins/redmine_more_previews/lib/redmine_more_previews/conversion.rb:340:in command' D:/redmine/apps/redmine/htdocs/plugins/redmine_more_previews/converters/libre/lib/libre.rb:41:in block in convert' convert Error  Failed to load pdf document Plugins_info Plugins_settings Plugins_settings_pdf Redmine_info Redmine_log.txt

vokamut commented 1 year ago

Activate the plugin in the project

2023-06-16_14-13

MFurminsky commented 1 year ago

Well, please, the plugin is active. Plugin gives message - Can't load pdf document. The whole process is reflected in the logs, the logs are linked. Redmine_log.txt

Went through the log. Performed all the actions displayed in the log. conversion takes place (temporary folders appear and disappear while the plugin is running). But at the time of index.pdf output, something is not working right. I will assume that the temporary folder and the pdf document in it are deleted before the document is displayed on the screen. I tried to do an experiment. Put a ban on deleting temporary folders and files. But then the move command does not work - the system cannot rename the converted document to index.pdf. I'm just watching in the temporary folder pdf document with a long unique name. Almost works. Slightly finish and take off)