Bug 156717 - Add minor version / OS to PDF producer metadata
Summary: Add minor version / OS to PDF producer metadata
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Adlair Cerecedo-Mendez
URL:
Whiteboard: target:24.8.0 target:25.2.0 target:24...
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
 
Reported: 2023-08-10 13:45 UTC by Hossein
Modified: 2024-06-14 17:14 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2023-08-10 13:45:18 UTC
Description:
For diagnostic purposes, it is very useful to know the exact minor version of the LibreOffice used to produce the PDF. This can be added to the "PDF Producer" metadata.

This metadata can be shown in almost any PDF viewer.

For example, instead of:
LibreOffice 7.5

It should be something like:
LibreOffice 7.5.3.2 (X86_64) / LibreOffice Community

For development versions, it would be something like:
LibreOfficeDev 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community

It would be good to even have the localized version of this text.

Code pointers:
If you look into filter/source/pdf/pdfexport.cxx, you will see that in PDFExport::Export(), aContext.DocumentInfo.Creator is set. You can change it to a new text, and see it in action, by setting:

aContext.DocumentInfo.Creator = "Hello world!";

And then exporting a file to PDF, looking into the metadata.

On the other hand, if you go to Help > About, you will see the same string is visible in the "About" dialog. If you look at cui/source/dialogs/about.cxx, you will see GetVersionString(), which provides the above (localized) string.

Combining these two, one can implement this feature.
Comment 1 V Stuart Foote 2023-08-12 14:49:08 UTC
+1
Comment 2 Mike Kaganski 2023-09-08 07:33:18 UTC
(In reply to Hossein from comment #0)
> It would be good to even have the localized version of this text.

Oh? The producer isn't a thing to have localized strings! One could add a locale data there, but not localized strings.
Comment 3 Adlair Cerecedo-Mendez 2023-10-02 06:17:04 UTC
Hi. I've added a patch for this here: https://gerrit.libreoffice.org/c/core/+/157424/1

Can somebody review it, please?
Comment 4 Buovjaga 2024-01-28 08:21:21 UTC
There's an incomplete patch here, if someone wants to continue: https://gerrit.libreoffice.org/c/core/+/159398/

In that case, add Co-authored-by: Firstname Lastname <email> to the end of the commit message.
Comment 5 Buovjaga 2024-01-30 09:47:00 UTC
A new patch was added again: https://gerrit.libreoffice.org/c/core/+/162734
Comment 6 Commit Notification 2024-03-08 15:51:17 UTC
Adlair Cerecedo-Mendez committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/fae655c430e7e61a867721d2aab0cb3d561e45a4

tdf#156717 Add minor version / architecture to PDF metadata

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2024-06-13 20:38:42 UTC
Hossein committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0e2409e5e3c73ec25c61aa4ea140d114869ea512

tdf#156717 Fix "LibreOffice Community" in PDF metadata

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2024-06-14 17:14:49 UTC
Hossein committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/2a984bb650ab201f186747d670e4a1d60915d987

tdf#156717 Fix "LibreOffice Community" in PDF metadata

It will be available in 24.8.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.