You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the gotenberg docker to convert a docx containing relative file links into a pdf.
The link path are not kept through the convertion:
For a link file:///./annexes/dir/file.xlsx, after convertion, the link is transformed into ../../.././annexes/dir/file.xlsx instead of ./annexes/dir/file.xlsx
Expected Behavior
For a link (in the OOXML) file:///./annexes/dir/file.xlsx, after convertion, the link is should be ./annexes/dir/file.xlsx
Current Behavior
For a link file:///./annexes/dir/file.xlsx, after convertion, the link is transformed into ../../.././annexes/dir/file.xlsx instead of ./annexes/dir/file.xlsx
Possible Solution
Not really sure what the issue is, i haven't looked much into the code of the conversion yet. It may be due to the command used to launch the conversion (The link is correct when i use unoconv -f pdf testing.docx to do the conversion).
Maybe launch the command from inside the temporary directory created
This is for delivering a archive containing the pdf and a list of assorted xls files which can be opened from the pdf (or the docx) instead of needing to browse through the folder to find the right one
Your Environment
I reproduced the issue with a simple docker run --rm -p 3000:3000 -e LOG_LEVEL="DEBUG" thecodingmachine/gotenberg:6 and a curl post request curl --request POST --url http://localhost:3000/convert/office --header 'Content-Type: multipart/form-data' --form files=@PATH_TO_FILE/testing.docx -o ./result.pdf
The text was updated successfully, but these errors were encountered:
Maybe launch the command from inside the temporary directory created
As suggested, I've tried this:
unoconv --user-profile ///tmp/40843 --port 40843 --format pdf --output 0SayLHLBOpzbIo3scrCcbN2s7QJ09GQfk.pdf testing.ll.docx
But no luck so far!
As far as I understand, unoconv resolves the / from /annexes... as the root path on the system. This is why we're getting ../../../assets because the conversion occurs in a path like /gotenberg/tmp/randomFolderName.
I've tried to update the link in the docx file with file:///./annexes/... instead of file:///annexes/... but again no luck.
I am using the gotenberg docker to convert a docx containing relative file links into a pdf.
The link path are not kept through the convertion:
For a link
file:///./annexes/dir/file.xlsx
, after convertion, the link is transformed into../../.././annexes/dir/file.xlsx
instead of./annexes/dir/file.xlsx
Expected Behavior
For a link (in the OOXML)
file:///./annexes/dir/file.xlsx
, after convertion, the link is should be./annexes/dir/file.xlsx
Current Behavior
For a link
file:///./annexes/dir/file.xlsx
, after convertion, the link is transformed into../../.././annexes/dir/file.xlsx
instead of./annexes/dir/file.xlsx
Possible Solution
Not really sure what the issue is, i haven't looked much into the code of the conversion yet. It may be due to the command used to launch the conversion (The link is correct when i use
unoconv -f pdf testing.docx
to do the conversion).Maybe launch the command from inside the temporary directory created
Steps to Reproduce (for bugs)
testing ll.pdf
testing ll.docx
I joined a docx (and the converted pdf) where the issue is visible. To reproduce:
Logs (LOG_LEVEL="DEBUG")
Not really useful here, except for the command launch to convert
Context
This is for delivering a archive containing the pdf and a list of assorted xls files which can be opened from the pdf (or the docx) instead of needing to browse through the folder to find the right one
Your Environment
I reproduced the issue with a simple
docker run --rm -p 3000:3000 -e LOG_LEVEL="DEBUG" thecodingmachine/gotenberg:6
and a curl post requestcurl --request POST --url http://localhost:3000/convert/office --header 'Content-Type: multipart/form-data' --form files=@PATH_TO_FILE/testing.docx -o ./result.pdf
The text was updated successfully, but these errors were encountered: