Add data to the description metadata of a pdf

User avatar
JimmyHartington
Advanced member
Posts: 278
Joined: Tue Mar 22, 2011 7:38 am

Re: Add data to the description metadata of a pdf

Post by JimmyHartington »

magnussandstrom wrote: Tue Aug 03, 2021 9:17 am I would love an example flow!
Hi Magnus

Here is an example flow. https://d.pr/f/spNLtk+

In my flows orange folders add private data. Dark blue are external folders.
I have included the .cmd file I made for EXIF tool in the zip. I am not sure if I need to add my script package. But if it is missing, then write back.

In this demo all the input folders (A, B and C) has add hierachy info set to yes. The Add Private Data folder adds a string of the metadata I need. So it is here that needs to be changed for other uses. I append the XMP Description here as well.
Write XML writes a XML-file in the format EXIF tool needs. This is then sorted out in its own folder, so I know where it is in for the .cmd program.
The .cmd program executes the EXIF tool command for adding the XMP Description, and then deletes the XML-file.

If somebody has a better idea for doing this I would like to hear. Especially about the dark blue external folder. If I could avoid this to make the flow a bit more simple it would be nice.

Image
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Add data to the description metadata of a pdf

Post by Padawan »

Some idea's to optimize it:
- Adjust the code of the "Write XML" script to store the text as dataset to the job + store the path to the dataset as private data
- Then use private data containing the path in the Execute Command

(Did not test this, but I think it should work)
jan_suhr
Advanced member
Posts: 586
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Add data to the description metadata of a pdf

Post by jan_suhr »

For those who don't have the Scripting Module they can use the Make XML app instead to create the XML
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
User avatar
JimmyHartington
Advanced member
Posts: 278
Joined: Tue Mar 22, 2011 7:38 am

Re: Add data to the description metadata of a pdf

Post by JimmyHartington »

Padawan wrote: Thu Aug 05, 2021 9:15 am - Then use private data containing the path in the Execute Command
How would you in a commandline access the path to the private data?
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Add data to the description metadata of a pdf

Post by Padawan »

If the path tot the dataset is stored in private data, then you can access it in execute command using a variable:
[Job.PrivateData:Key="PrivateDataFieldContainingPath"]
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Add data to the description metadata of a pdf

Post by Padawan »

I've created a flow with minimal scripting which does this:
z-Demo of processing info updated.sflow.zip
(14.89 KiB) Downloaded 289 times
- Create an XML dataset using the "Create Log" app
- Store the path to the dataset as private data using "Data Mapper" and a small script expression:
var ds = job.getDataset("Xml");
var dsPath = ds.getPath();
dsPath;
- Use the path in the exiftool command via "Run Command"
User avatar
JimmyHartington
Advanced member
Posts: 278
Joined: Tue Mar 22, 2011 7:38 am

Re: Add data to the description metadata of a pdf

Post by JimmyHartington »

jan_suhr wrote: Thu Aug 05, 2021 9:56 am For those who don't have the Scripting Module they can use the Make XML app instead to create the XML
It should also be possible to use the free app Create text file.
https://www.enfocus.com/en/appstore/pro ... -text-file
User avatar
JimmyHartington
Advanced member
Posts: 278
Joined: Tue Mar 22, 2011 7:38 am

Re: Add data to the description metadata of a pdf

Post by JimmyHartington »

Padawan wrote: Thu Aug 05, 2021 3:43 pm I've created a flow with minimal scripting which does this:
z-Demo of processing info updated.sflow.zip
Thanks. Will look at this when I get some more time.
Post Reply