publisher icon indicating copy to clipboard operation
publisher copied to clipboard

read metadata from PDF

Open pr-apes opened this issue 2 years ago • 3 comments

@pgundlach,

would it be possible that Publisher could read from other PDF documents the metadata it can set?

I mean the following functions:

  1. sd:pdf-title().
  2. sd:pdf-subject().
  3. sd:pdf-author().
  4. sd:pdf-creator().
  5. sd:pdf-keywords().

Many thanks for your help.

pr-apes avatar Sep 26 '22 06:09 pr-apes

This is only useful not only to import metadata, but to remove some of them in certain cases (names, user IDs...).

pr-apes avatar Sep 26 '22 06:09 pr-apes

Reading should be possible, changing an external PDF file sounds like a non-trivial tasks.

Reading could be built in, but can also be achieved by running an external process such as pdfinfo from poppler and parsing the output.

pgundlach avatar Sep 26 '22 07:09 pgundlach

Sorry for my poor explanation, since I understand that it makes no sense to pretend that Publisher edits PDF files.

Similar to the recipe from https://doc.speedata.de/publisher/en/cookbook/multipagepdf/, metadata could be also copied (but only when they can be read).

I thought of something similar to this function: https://github.com/speedata/publisher/blob/d40b376ecc1e20db72888230d219d6f591f87d54/src/lua/publisher/layout_functions.lua#L250-L254.

I hope it is clear now.

pr-apes avatar Sep 26 '22 08:09 pr-apes

I will close this as I don't see a very easy way to include this. It would be possible with some programming, but for that I need a sponsor.

pgundlach avatar Nov 10 '22 12:11 pgundlach