Can't overwrite file after OCR

This Forum is for the use of End Users requiring help and assistance for Tracker Software's PDF-Tools.

Moderators: TrackerSupp-Daniel, Tracker Support, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Tracker Supp-Stefan

Post Reply
TheRealFentonius
User
Posts: 5
Joined: Tue Aug 31, 2010 1:08 pm

Can't overwrite file after OCR

Post by TheRealFentonius » Wed Apr 14, 2021 3:12 pm

Hi there, I'm very new to PDFTools and am trying to add an OCR layer to existing PDF files, so I don't want to rename the files in any way. When I run the tool I get an error message at the end saying "The process cannot access the file because it is being used by another process". I've attached a screenshot so you can see what I mean.
Any clue what I'm doing wrong?
Thanks... Peter
image.png

User avatar
Paul - Tracker Supp
Site Admin
Posts: 5231
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Can't overwrite file after OCR

Post by Paul - Tracker Supp » Wed Apr 14, 2021 3:32 pm

Hi TheRealFentonius,

thanks for the post. There are tools available that we can use to determine exactly what has a handle on that file keeping it open. Before we go there I would ask you to check that you do not have Windows Explorer open to that target folder, and that the file in question is not being previewed in the Windows Explorer Preview Pane. That has the potential to cause this.

If you are absolutely certain that noting is using that file other than PDDF-Tools you can download a copy of "process Explorer" from Microsoft and we can walk you through using it to determine what is locking those files. https://docs.microsoft.com/en-us/sysint ... s-explorer

I am keen first however to know if the Windows file explorer is previewing that file.

regards
_________________
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com

Willy Van Nuffel
User
Posts: 1713
Joined: Wed Jan 18, 2006 12:10 pm

Re: Can't overwrite file after OCR

Post by Willy Van Nuffel » Wed Apr 14, 2021 3:39 pm

Hi all,

For me, it seems like the problem comes from the "Batch Processing Mode" that is not activated.

Please turn in ON and try again.

Best regards.
Attachments
PDF-XChange Tools - OCR Pages.png
PDF-XChange Tools - OCR Pages.png (8.52 KiB) Viewed 361 times

TheRealFentonius
User
Posts: 5
Joined: Tue Aug 31, 2010 1:08 pm

Re: Can't overwrite file after OCR

Post by TheRealFentonius » Wed Apr 14, 2021 4:54 pm

Great, turning on batch processing worked - thanks for the assist...
Peter

TheRealFentonius
User
Posts: 5
Joined: Tue Aug 31, 2010 1:08 pm

Re: Can't overwrite file after OCR

Post by TheRealFentonius » Wed Apr 14, 2021 4:59 pm

Sorry, I spoke too soon.
I created a new tool which OCRed and then converted to PDF/A, called unoriginally "OCR & PDF/A". When I run this tool with both Batch Processing and Multi-Threaded Processing turned on, then I get the same error message when trying to save. Again, here's a screenshot...
image.png

TheRealFentonius
User
Posts: 5
Joined: Tue Aug 31, 2010 1:08 pm

Re: Can't overwrite file after OCR

Post by TheRealFentonius » Wed Apr 14, 2021 6:21 pm

Obviously (!) the last try was with all Windows Explorer windows shut. I've downloaded Process Explorer - what now?
Here's a shot of the Process Explorer window.
image.png
Attachments
image1.png

Willy Van Nuffel
User
Posts: 1713
Joined: Wed Jan 18, 2006 12:10 pm

Re: Can't overwrite file after OCR

Post by Willy Van Nuffel » Wed Apr 14, 2021 8:50 pm

I did run a few tests and the problem comes from the "Convert to PDF/A" action.
When you run it separately, saving to the original file, you get the same error message.

I do not know if it is normal or not that - when using this action - the existing file cannot be overwritten by PDF-XChange Tools.
PDF-XChange Editor has no problem with that.
@Tracker Support : do you have an explanation for this different behavior ?

A work-around would be to save the PDF/A files with another name, like shown by default => %[FileName]_(PDFA)

User avatar
Paul - Tracker Supp
Site Admin
Posts: 5231
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Can't overwrite file after OCR

Post by Paul - Tracker Supp » Wed Apr 14, 2021 10:39 pm

Thanks for that Willy,

TheRealFentonius, I asked the devs about this and it seems we need to reproduce this to investigate, it does seem like PDF-Tools may be blocking that.

May I ask you to export the Tool you created and send it to us at support@tracker-software.com please?

regards
_________________
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com

TheRealFentonius
User
Posts: 5
Joined: Tue Aug 31, 2010 1:08 pm

Re: Can't overwrite file after OCR

Post by TheRealFentonius » Thu Apr 15, 2021 10:37 am

Thanks Willy & Paul, I've sent the exported tool to the support email, so I guess we'll see what they come back with. Out of interest I tried to change the order of operation within the created tool and it made absolutely no difference!

User avatar
Paul - Tracker Supp
Site Admin
Posts: 5231
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Can't overwrite file after OCR

Post by Paul - Tracker Supp » Thu Apr 15, 2021 5:38 pm

Hi again TheRealFentonius,

I tested your tool here and every time it saves without issue. Can you reproduce this on any other devices or is it specific to this one PC?

If we cannot reproduce the issue we would need to do a remote debug session on your machine to determine what is happening. It was pointed out to me that while Process Explorer MAY help, it is entirely possible that the lock(s) on the files may be temporary and gone by the time you look with Process Explorer.

So please do let us know if the issue can be reproduced and if so please provide steps how to do it as I was unable to do so.

regards
_________________
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com

Willy Van Nuffel
User
Posts: 1713
Joined: Wed Jan 18, 2006 12:10 pm

Re: Can't overwrite file after OCR

Post by Willy Van Nuffel » Thu Apr 15, 2021 5:48 pm

Hi Paul,

Thanks for being prepared to further investigate this problem.

I would like to make clear that you should be able to reproduce the problem when you save the file to the same location AND with the same filename. This means that the resulting PDF must overwrite the original file. See screenshot with error message.

I think that PDF-Tools does not close the original document (or does not wait until it is closed) before writing the new PDF.

Best regards.
Attachments
PDF-XChange Tools - Convert to PDFA.png

User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2056
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Can't overwrite file after OCR

Post by Vasyl-Tracker Dev Team » Tue Apr 20, 2021 8:56 pm

Hi Willy.

Please try the latest 353 build. Thanks.

Cheers.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

User avatar
Paul - Tracker Supp
Site Admin
Posts: 5231
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Can't overwrite file after OCR

Post by Paul - Tracker Supp » Thu May 13, 2021 2:17 pm

For the benefit of those reading this, the issue was further investigated with the discussion via email.
"The process cannot access the file because it is being used by another process" issue, the devs found the cause and have made a fix. which will be available in our next build (9.0.355.0).

As a work around you may try to use:

MultiThreaded=OFF and BatchProcessing=ON

OR

MultiThreaded=ON and BatchProcessing=OFF

but NOT the combination:

MultiThreaded=ON and BatchProcessing=ON
I hope that helps.
_________________
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com

Post Reply