8 Replies Latest reply on Aug 21, 2014 2:48 AM by [Jongware]

    PDF Export - setting 'PDF Producer'

    curela Level 1



      Can anyone help me ...


      I would like to set-up a different 'PDF Producer' in the exported PDF properties (other than Adobe PDF Library).


      I looked at the PDFExportPreference help but I don't see that option.


      Can it be set as metadata at the Document level? But wouldn't the pdf export overwrite it?


      Thank you!


        • 1. Re: PDF Export - setting 'PDF Producer'
          Laubender Adobe Community Professional & MVP

          You cannot do this with InDesign.


          I think for that you have to edit the PDF in Acrobat Pro at a very low level…

          And you can wreck your PDF by doing the following:
          To do that, the PDF should not be "optimized" or "encrypted" and you would open the PDF with an text editor app. Search for the string you want to change and exchange every instance of it with the new contents. Save the file as text only.


          Do this always on a duplicate of the PDF.
          Do not expect that the PDF will work as intended after editing.
          If it does, you are lucky. Validate it with Acrobat Pro's Preflight feature thoroughly!


          That said with all the warnings:

          WHY on earth do you want to do this?


          (Needless to say, that the editing process can be scripted by ExtendScript e.g. out of inDesign; I will give no further hints, because this is outright dangerous)






          //Some edits made to this post.

          • 2. Re: PDF Export - setting 'PDF Producer'
            curela Level 1

            thanks for the feedback!


            Well, I have to do it because it is requirement.

            The "feature" I am talking mainly converts Indessign files to PDF on Indesign Server using the scripts of course. The resulting PDF's have to be branded with the company I work for.

            Hmm, strange that you can't set metadata on the PDF export.


            There are other tools that can set the metadata but I didnt want to go through another step. My question is mostly if it can be done with javascript and the indesign object model.

            • 3. Re: PDF Export - setting 'PDF Producer'
              Laubender Adobe Community Professional & MVP

              You can set metadata, the EXIF information, also an advanced set of EXIF in Acrobat Pro. But I think that wouldn't be enough to reach your goal. So maybe scripting Acrobat Pro allows what you want, but this lies not in my realm of expertise.



              • 4. Re: PDF Export - setting 'PDF Producer'
                curela Level 1

                Hi Uwe,


                Let't say I must set it on Indesign Server CC and I would like a clean API using scripting. For this discussion, the solution has to be in those limits (because I have other solutions but those would add overhead that I might not want).

                From what you are saying, that is not possible or you think it's not possible.




                • 5. Re: PDF Export - setting 'PDF Producer'
                  Laubender Adobe Community Professional & MVP

                  Hi, Cristian!

                  I think it's not possible, if you are staying with the scripting DOM of inDesign. But I already hinted to the possible solution to read a file (the exported PDF), doing some edits and write that file back to disk. This of course is in the scope of the core capability of ExtendScript.



                  • 6. Re: PDF Export - setting 'PDF Producer'
                    [Jongware] Most Valuable Participant

                    curela wrote:


                    ... I have to do it because it is requirement.


                    Please re-read where ever you got this from very, very carefully ...


                    Why would it ever be a "requirement" with what particular software library you created a PDF with? What advantage could it have to lie about this? (As changing the PDF Producer, a simple string, does nothing to the rest of the PDF.)


                    My $0.02 is that you misread an instruction somewhere and you actually have to set the regular metadata such as "Title", "Author", and "Subject". (Which can be scripted.)

                    • 7. Re: PDF Export - setting 'PDF Producer'
                      curela Level 1

                      Thanks for the feedback Jongware, appreciate it.


                      I can't speak for the product manager (I'll check with him later) on why. But I am 100% it's the PDF Producer and Creator (or Application) actually. I am looking at them on a PDF that comes from Word and goes through another flow to get PDF rendition.


                      I guess it's a branding thing. I was working for another content management company few years back and they had the same thing. I am certainly more of a novice with pdf and adobe stuff, but to me it would make sense to leave the Author alone, at least for my use case.

                      Mind you, I don't create Indesign documents, I just have to convert them (and PSD,AI) to PDF using Indesign. The request is to mark that company "xyz" produced this PDF.


                      If I read your answer correctly, you too confirm I can't do this in a clean manner using javascript (dom/api) with ID server CC, right ?  



                      • 8. Re: PDF Export - setting 'PDF Producer'
                        [Jongware] Most Valuable Participant



                        Here is some more information:


                        1. Through the regular DOM, the class MetadataPreference allows reading and writing of 'common' PDF metadata; but "Producer" is missing from the list of supported strings. A similar item, "Creator", is present, but it is marked Read Only and returns the full name of your current InDesign.


                        2. The PDF object you are looking for is "/Info". This is one of the objects pointed to in the file trailer dictionary (see Table 3.13 in the PDF Reference v1.7). It is marked "optional", so you cannot be 100% sure it is actually present (although it's a fair guess it always will be there in PDFs created by InDesign).


                        3. The Info object contains Key-Value strings such as Author, Title, and Keywords (which can be entered in an InDesign document, and changed in Acrobat Pro) as well as document-specific values such as CreationDate, Creator, and (indeed) Producer.


                        4. The Info object may be compressed!


                        Changing the string inside an existing PDF is possible with Javascript, but only with a generous interpretation of "possible". It requires taking apart a PDF into separate objects (decompressing flate-compressed objects where necessary), changing the string, then re-building the PDF from the bottom up. Funny enough, Javascript should have no problems with taking apart and reassembling a PDF, but decompressing is an absolute show-stopper. The version of Javascript that InDesign uses is extremely bad in pure binary operations...


                        Acrobat Pro does not allow altering these fields either.

                        A possible solution could be http://qpdf.sourceforge.net/. This is a simple tool to convert a PDF to and from editable text.