5 Replies Latest reply on Apr 14, 2009 4:13 AM by marcapo GmbH

    IDS CS4: Check for neccessary update of image links

    marcapo GmbH

      Operating System Windows.

      IndesignServer CS4.

      Problem:

      IDS checks links to images if the source file was modifies.

      It seems that checks are made on the modification date and the size of the file.

      If the file was modified, then IDS shows a grey rectangle instead of the image.

      There is also a method in the JAVA-API for IDS to check the link status: link.getStatus() == kLinkStatusLinkOutOfDate.value.

      But this only works if the new modification date is after the link.getDate() value.

      But when the new modification date is before the link.getDate() value, the check link.getStatus() delivers kLinkStatusNormal.value

      and IDS shows a grey rectangle and there is no way (as far as i know) to check with the JAVA-API for IDS that i have to call link.update() so the image is shown correctly.

       

      For Example

      An image link in an ID-document points to following file

           Path: c:/test.jpg

           Modification date: 01.May.2008 10:00:00

           File size: 1.5 MB

      And the creation date (link.getdate()) of the link is 15.February.2009 09:00:00

      Now we check the link object:

           link.getDate() == 15.February.2009 09:00:00

           link.getSize() == 1.5 MB

           link.getStatus() == kLinkStatusNormal.value

       

      Now we make a backup of our original c:/test.jpg and we copy a new file to c:/test.jpg with following attributes: 

           Path: c:/test.jsp 

           Modification date: 02.April.2009 14:00:00

           File size: 0.9 MB

      Now let us again check the link object:

           link.getDate() == 15.February.2009 09:00:00

           link.getSize() == 1.5 MB

           link.getStatus() == kLinkStatusLinkOutOfDate.value

      So we know, we have to call link.update() that the image is rendered in the ID-document,

      because link.getStatus() says it and the link.getSize() isn't the file size.

       

      Now we copy the old file back to c:/test.jpg:

           Path: c:/test.jsp 

           Modification date: 01.May.2008 10:00:00

           File size: 1.5 MB

      Now let us again check the link object:

           link.getDate() == 15.February.2009 09:00:00

           link.getSize() == 1.5 MB

           link.getStatus() == kLinkStatusNormal.value

      In this case we do not know that we have to call link.update(), because link.getSize() is the same as file size

      and link.getStatus() is kLinkStatusNormal.value.

      But IDS doesn't render the image and shows a grey rectangle instead.

       

      Is there any other way to check, if link.update() has to be called, so that the image is rendered?

        • 1. Re: IDS CS4: Check for neccessary update of image links
          jeffzhli

          after link.update() ,the index has changed,1 changed to 0, 2 changed to 1, I solved your question by one day time.

          MSN: jeffzhli@163.com

          • 2. Re: IDS CS4: Check for neccessary update of image links
            marcapo GmbH Level 1

            No, this is not the answer to my question.

            If the source file of an image link changes (not with indesign, but by OS) the link index doesn't change.

            I need a way how to check if a link needs to be updated. Not if link.update() was called.

            The problem is, that if the modification date of the file is older then the link.date then IDS knows that the link has to be updated.

            But i have found no reliable method to check if the the link needs to be updated, because in this case itemLink.getStatus() returns kLinkStatusNormal and not as assumed kLinkStatusLinkOutOfDate.

            The problem is not only in already opened ID-documents, but also in new opened ID-documents.

            If the source file of an link has changed IDS renders only a grey rectangle.

            So if the link.index would change (if the source of an link is changed by OS) i cannot proof it for a new opened document.

            And i cannot generally call update on each link-object because this would take to much time to open a document respectivly to render a opened document (additional 5-10 seconds, this is too much for our application).

            • 3. Re: IDS CS4: Check for neccessary update of image links
              jeffzhli Level 1
              What I mean is to update all the links so that you can display the. Of course, would be a waste of time. You said. I do not know.
              • 4. Re: IDS CS4: Check for neccessary update of image links
                jeffzhli Level 1

                What I mean is to update all the links so that you can display the. Of course, would be a waste of time. You said. I do not know.

                 

                 

                 

                 

                在2009-04-14,marcapo <forums@adobe.com> 写道:

                >No, this is not the answer to my question.

                >If the source file of an image link changes (not with indesign, but by OS) the link index doesn't change.

                >I need a way how to check if a link needs to be updated. Not if link.update() was called.

                >The problem is, that if the modification date of the file is older then the link.date then IDS knows that the link has to be updated.

                >But i have found no reliable method to check if the the link needs to be updated, because in this case itemLink.getStatus() returns kLinkStatusNormal and not as assumed kLinkStatusLinkOutOfDate.

                >The problem is not only in already opened ID-documents, but also in new opened ID-documents.

                >If the source file of an link has changed IDS renders only a grey rectangle.

                >So if the link.index would change (if the source of an link is changed by OS) i cannot proof it for a new opened document.

                >And i cannot generally call update on each link-object because this would take to much time to open a document respectivly to render a opened document (additional 5-10 seconds, this is too much for our application).

                >

                • 5. Re: IDS CS4: Check for neccessary update of image links
                  marcapo GmbH Level 1

                  My temporary solution now is to save some metadata of the linked image as a label in the link and compare these.

                  But i would prefer a solution over the IDS-API, if there is one.