Jump to content
You must now use your email address to sign in [click for more info] ×

Updating Linked documents


Recommended Posts

I'm updating a linked document outside of Designer and most of the time (but not always) I'm seeing the following error message popup at the same time as the notification that the linked document has changed.

image.png.a67b71cddbde2e35b6a2794babf489ba.png

I'm guessing that this is a timing and/or locking issue, such that when the PDF is being written AD can't access it. I would be surprised if the file can't really be found. I suspect that the file cannot be accessed due to a lock during the write which isn't released until the write has completed. Maybe a "back-off and retry" or check for the file existing in the directory before reporting that it cannot be found.

Link to comment
Share on other sites

Where is the file located? Internal drive, external drive, network drive?

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

  • Staff

Hi Paul Mc,

I did get this once myself last week, but haven't been able to get it to re-appear. Do you have a set of files you could attach where you can replicate it fairly regularly? If you can what operations are you doing in the file to help reproduce?

Link to comment
Share on other sites

Hi @Sean P unfortunately all this is with client work and I'm unable to share it here. Please give me a day or so and I will cobble something together to illustrate it.

Just for information, this is a repeatable effect and always occurs. I have automatically update checked in settings. I'm using an application that I have written to generate a new PDF file on request. This PDF is linked into the afdesign file. When I click Export in the app a new PDF is created overwriting the previous one and using the same filename. I think what is happening is that there is a shell event listener set up to notify changes which gets fired, this then causes AD to immediately try to open the file but my application has it locked while it gets written. I'm guessing that there is a retry that eventually succeeds but by then there is an error message dialog on screen which appears at the same time as the change detected message (but doesn't go away until OK is clicked).

I should be able to get something together tomorrow evening which will show this happening.

Link to comment
Share on other sites

  • 2 weeks later...
  • Staff

Thanks for the video, and apologies for the slow response - unfortunately it is still proving to be elusive for me.

I've tried creating a PDF from Inkscape and kept export to that whilst linked to within Affinity, and that just detects the file has changed - as you would expect.

I then tried opening it in Acrobat (as I know that puts a lock on a file) and then modifying it and saving, but again Affinity is just marking it as modified and then I can update without an issue.

I then wondered if your Title Block application was maybe deleting the PDF first before reexporting out (would make sense with the File Not Found message), however again I'm not seeing any error box here when deleting the file manually within Windows and then replacing - instead Resource Manager just reports the file as missing and then goes back to modified when its exported out again.

If you wouldn't mind sending your documents over that would be great! However can I be really cheeky and ask if you would also be able to attach a copy of your application (it will remain internal to Serif only for investigating this issue)- I'm wondering if it is the missing piece of the puzzle for me. If you don't feel comfortable with that, are you able to try to replicate the operations the application is doing yourself in Windows to see if you can replicate it that way?

I've created a link to our internal Dropbox account that you can upload the required files.
https://www.dropbox.com/request/lrNVNzv8I43p0w0YhcAb

Thanks,

 

Link to comment
Share on other sites

Hi @Sean P, I'll construct a sample and send that through for you to play with. Please give me a day or two to get this organised. Thanks.

Although I didn't write the library code for the PDF file write I suspect that if the file already exists then it simply opens it for writing with an exclusive lock and overwrites the contents. It is possible that it is deleting the file and then writing a new one with the same name. I will do a quick test to see if deleting (or renaming) the old file first before writing the new one makes any difference.

Link to comment
Share on other sites

Hi @Sean P I've prepared an example and uploaded it to the DropBox location. If you've any questions about it then please let me know.

Also, I tried various methods of overwriting the file directly, deleting first and then creating a new file and also, with a short delay before creating the file, creating with temp name and renaming and none of these methods made any difference, the error message still popped up.

Link to comment
Share on other sites

  • Staff

Hi Paul Mc,

Thank you very much for that! I can reproduce the issue both inside and outside of using your Application! The key to the reproduction here was the 'Automatically Update Linked Resources' preferences option that I didn't have enabled! As soon as I enable that I can just use Acrobat to re save over the placed PDF and get the File Not Found message.

Interestingly I was able to get a reproducible crash if I resaved over the 'Test.pdf' using your 'Instructions.pdf' so I'll also get that logged to be looked at.

Thanks again for your patience.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.