elwerene / libreoffice-convert

MIT License
249 stars 96 forks source link

The conversion of footer text from DOCX to PDF is not done properly #124

Closed roughsky closed 1 month ago

roughsky commented 1 month ago

I tried to convert a docx file to pdf and noticed that the footer text is not able to convert properly. For eg in the below attached screenshots, the value for text "Document type" is not converted properly and is getting hardcoded to "source" while another footer in next line named "Date" is fine. Rest of the file is good. I'm using v1.5.1 by the way.

Screenshots:

Docx

Screenshot 2024-07-16 at 7 22 01 PM

Pdf

Screenshot 2024-07-16 at 7 21 36 PM

PFB the file which was used for conversion: Footer Issue.docx

elwerene commented 1 month ago

Does the conversion work without problem with libre Office?

Am 16. Juli 2024 16:56:23 MESZ schrieb roughsky @.***>:

I tried to convert a docx file to pdf and noticed that the footer text is not able to convert properly. For eg in the below attached screenshots, the value for text "Document type" is not converted properly and is getting hardcoded to "source" while another footer in next line named "Date" is fine. Rest of the file is good. I'm using v1.5.1 by the way.

Screenshots:

Docx

Screenshot 2024-07-16 at 7 22 01 PM

Pdf

Screenshot 2024-07-16 at 7 21 36 PM

PFB the file which was used for conversion: Footer Issue.docx

-- Reply to this email directly or view it on GitHub: https://github.com/elwerene/libreoffice-convert/issues/124 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

roughsky commented 1 month ago

When exporting this DOCX file to PDF in LibreOffice, it actually overrides the value under "Document Name" with the file name.

PFB ss:

Screenshot 2024-07-17 at 11 15 36 AM
roughsky commented 1 month ago

Hey Rene, Can you share any update pls?

On Tue, 16 Jul 2024, 20:46 René Rössler, @.***> wrote:

Does the conversion work without problem with libre Office?

Am 16. Juli 2024 16:56:23 MESZ schrieb roughsky @.***>:

I tried to convert a docx file to pdf and noticed that the footer text is not able to convert properly. For eg in the below attached screenshots, the value for text "Document type" is not converted properly and is getting hardcoded to "source" while another footer in next line named "Date" is fine. Rest of the file is good. I'm using v1.5.1 by the way.

Screenshots:

Docx Screenshot 2024-07-16 at 7 22 01 PM

Pdf Screenshot 2024-07-16 at 7 21 36 PM

PFB the file which was used for conversion: Footer Issue.docx

-- Reply to this email directly or view it on GitHub: https://github.com/elwerene/libreoffice-convert/issues/124 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/elwerene/libreoffice-convert/issues/124#issuecomment-2231196850, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJ4TAN4FLBAZEM4IPPHR7YTZMU2MXAVCNFSM6AAAAABK6Y3DEWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZRGE4TMOBVGA . You are receiving this because you authored the thread.Message ID: @.***>

elwerene commented 1 month ago

Not really. If it does not work in libreoffice, it can not work in this library..

roughsky commented 1 month ago

Did you check my comment on libreoffice? Exporting docx to pdf worked fine in it with footer's "Document name" taking up the file name and not overriding it to "source".

On Fri, 19 Jul 2024, 14:29 René Rössler, @.***> wrote:

Not really. If it does not work in libreoffice, it can not work in this library..

— Reply to this email directly, view it on GitHub https://github.com/elwerene/libreoffice-convert/issues/124#issuecomment-2238703287, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJ4TAN6QD66Q4Z4VKQACS6LZNDIQ7AVCNFSM6AAAAABK6Y3DEWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZYG4YDGMRYG4 . You are receiving this because you modified the open/close state.Message ID: @.***>

elwerene commented 1 month ago

Then I missunderdtood your comment. Did you export to pdf in libreoffice or print to pdf? That's a difference..

roughsky commented 1 month ago

Export to pdf

On Fri, 19 Jul 2024, 16:39 René Rössler, @.***> wrote:

Then I missunderdtood your comment. Did you export to pdf in libreoffice or print to pdf? That's a difference..

— Reply to this email directly, view it on GitHub https://github.com/elwerene/libreoffice-convert/issues/124#issuecomment-2238917878, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJ4TAN2EQZS3EKIKF72Q6T3ZNDXYNAVCNFSM6AAAAABK6Y3DEWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZYHEYTOOBXHA . You are receiving this because you modified the open/close state.Message ID: @.***>

elwerene commented 1 month ago

So the document uses the name of the file in this.

@roughsky You could make a pr to make this configurable. Changes are needed wherever "source" is mentioned. You could add this to the options and keep the default "source".

If you make the pr, I'm happy to review and release it.

elwerene commented 1 month ago

Fix is released in version 1.6.0. Thanks @roughsky