Set PDF metadata using Livecode
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 27
- Joined: Wed Nov 15, 2006 11:27 am
Set PDF metadata using Livecode
Is it possible to modify the metadata of a document (PDF) using Livecode?
Is there any stack around able to accomplish this task?
Thanks
Paolo
Is there any stack around able to accomplish this task?
Thanks
Paolo
Paolo Mazza
Italy
Italy
Re: Set PDF metadata using Livecode
Buongiorno Paolo,
no, currently only setting metadata (and only the "density") when exporting images are supported in LC 8.x.
See the dictionary for "export image with metadata..."
Best
Klaus
no, currently only setting metadata (and only the "density") when exporting images are supported in LC 8.x.
See the dictionary for "export image with metadata..."
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 9847
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Set PDF metadata using Livecode
See the optional "with options <array>" clause for the "open printing to PDF" entry in the Dictionary.
Currently the supported metadata includes: Title, Author, Subject, Keywords, Creator, Producer. Their values can be any string.
This only applies to PDFs generated within LiveCode, however. If you need to modify a PDF generated elsewhere you may need to use an external tool for that, though many can be invoked with a command line call executed in LiveCode's shell function.
Currently the supported metadata includes: Title, Author, Subject, Keywords, Creator, Producer. Their values can be any string.
This only applies to PDFs generated within LiveCode, however. If you need to modify a PDF generated elsewhere you may need to use an external tool for that, though many can be invoked with a command line call executed in LiveCode's shell function.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Set PDF metadata using Livecode
Ah, yes, completely forgot about that one!
However I had the impression that Paolo meant existing PDF documents!?
However I had the impression that Paolo meant existing PDF documents!?
-
- VIP Livecode Opensource Backer
- Posts: 9847
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Set PDF metadata using Livecode
I think you're right, but it seemed worth mentioning on the odd chance that generating new PDFs may be an option. And if not hopefully a command line tool can help fill in the gaps, or using calls to a PDF library more directly via LiveCode Builder.Klaus wrote:Ah, yes, completely forgot about that one!
However I had the impression that Paolo meant existing PDF documents!?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 27
- Joined: Wed Nov 15, 2006 11:27 am
Re: Set PDF metadata using Livecode
Thank you all. Yes I meant existing PDF documents.
People said that Hypercard was able to accomplish this task. So I thought LiveCode can do the same.
Thank you very much.
Paolo
People said that Hypercard was able to accomplish this task. So I thought LiveCode can do the same.
Thank you very much.
Paolo
Paolo Mazza
Italy
Italy
-
- Posts: 27
- Joined: Wed Nov 15, 2006 11:27 am
Re: Set PDF metadata using Livecode
By the way, any chance to create and save a pdf file from a stack in the LiveCode server using the "open printing to PDF" command?
I tried but I got an error.
I am supposed to use the on-rev server with LiveCode 6.5 .
Thanks
Paolo
I tried but I got an error.
I am supposed to use the on-rev server with LiveCode 6.5 .
Thanks
Paolo
Paolo Mazza
Italy
Italy
-
- VIP Livecode Opensource Backer
- Posts: 9847
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Set PDF metadata using Livecode
Interesting. HypeCard was EOL'd by its manufacturer years before PDF became an open standard. It would be interesting to learn how HyperCard might have been able to solve this.PaoloMazza wrote:Thank you all. Yes I meant existing PDF documents.
People said that Hypercard was able to accomplish this task. So I thought LiveCode can do the same.
That's a fairly old version. Why are you unable to use a more recent one?I am supposed to use the on-rev server with LiveCode 6.5 .
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 27
- Joined: Wed Nov 15, 2006 11:27 am
Re: Set PDF metadata using Livecode
Hi Richard,
I was told Hypercard was able to change metadata of all documents in MAC OS. It was not like that?
I thought that's because they consider it the most stable version of LC server.
Can I ask them to update the version of LiveCode in their server?
Best regards,
Paolo Mazza
I was told Hypercard was able to change metadata of all documents in MAC OS. It was not like that?
I use the on-rev server which at the moment runs version 6.5 of LiveCode server.PaoloMazza wrote: That's a fairly old version. Why are you unable to use a more recent one?
I thought that's because they consider it the most stable version of LC server.
Can I ask them to update the version of LiveCode in their server?
Best regards,
Paolo Mazza
Paolo Mazza
Italy
Italy
Re: Set PDF metadata using Livecode
PDF metadata is complicate, because there are several mechanisms available within PDF files to add metadata:
edit it, then
- The Info Dictionary has been included in PDF since version 1.0. It contains a set of document info entries, simple pairs of data that consist of a key and a matching value. Some of these are predefined, such as Title, Author, Subject, Keywords, Created (the creation date), Modified (the latest modification date) and Application (the originating application or library). Applications can add their own sets of data to the info dictionary. Probably this is standard livecode way.
- XMP (Extensible Metadata Platform) is an Adobe technology for embedding metadata into files. It can be used with a wide variety of data files. With Acrobat 5 and PDF 1.4 (2001) this mechanism was also made available for PDF files. XMP is more powerful than the info dictionary, which is why it is used in a number of PDF-based metadata standards.
- Additional ways of embedding metadata are the PieceInfo Dictionary (used by Illustrator and Photoshop for application specific data when you save a file as a PDF), Object Data (or User Properties) and Measurement Properties.
Code: Select all
put shell("pdftools.exe -r -i C:\test.pdf ) into oldXMP
Code: Select all
put newXMP into URL "C:\metadata.xmp"
put shell("pdftools.exe -i C:\test.pdf -o C:\out.pdf -e " & quote & "C:\metadata.xmp" & quote)
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w