Roger,
One of our hourly runs for a client creates pdf's for drivers to pick up their pay preview for the week so far. Been running it all year. The employees can also open the pdfs by driver. Not an issue, but have one problem. (Note:drivers can get files on their phone app)
As these are being created (using bullzip and the same name each time for the current pay period) the pdf may be open by the driver or employee and a message comes up to cancel or retry. Found it testing, but it runs on task scheduler so no human can answer and neither would allow to skip that driver and just go to the next one, which is what we would do if we could.
Very rare for this to happen, but it did today, which was unexpected.
Any ideas on how to get by the error, or check the pdf for being open or not. (guess we could try to delete it and if still there, bypass?)
Thanks
Fred
Omni
printing to pdf error
Re: printing to pdf error
Fred -
I read your complaint 5 times and I have no idea what error you are getting.
Please be more specific.
Roger
I read your complaint 5 times and I have no idea what error you are getting.
Please be more specific.
Roger
The eXpress train is coming - and it has more cars.
Re: printing to pdf error
I understand that sometimes those PDF files can't be opened. You have to investigate those files, Fred. Maybe they were damaged during transport or there weren't created successfully. There are lots of possible reasons.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: printing to pdf error
I don't know how you are giving the PDF file to the driver.
Is this an email attachment?
Sometimes a server can be slow at emptying its file-write buffer if it is very busy.
If you have another service that sends it out as an email immediately after the print job, it could be that there needs to be a few second delay in that process.
Is this an email attachment?
Sometimes a server can be slow at emptying its file-write buffer if it is very busy.
If you have another service that sends it out as an email immediately after the print job, it could be that there needs to be a few second delay in that process.
The eXpress train is coming - and it has more cars.
Re: printing to pdf error
From windows. "file is open and cannot be created" when it tries to write the pdf. Then a retry or cancel
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: printing to pdf error
You can try to open the pdf exclusive, f.e.
Code: Select all
do while (nH := FOpen(outfile, FO_EXCLUSIVE)) <= 0 .and. counter < 10
sleep(100)
counter++
enddo
if nH > 0
FClose(nH)
endif
if counter > 10
err := 1
endif
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: printing to pdf error
It appears that you are using the same name for the PDF each time it is being created and a previous print job never finished and closed the file."file is open and cannot be created"
The eXpress train is coming - and it has more cars.
Re: printing to pdf error
Guess a lot of confusion. The files are created hourly for the weeks pay and copied to the same place, same file name for each driver id. The drivers have an app on their phone where they can open and view the files via a 3rd party. The files are something like 'payweek_40'. The app requires the same file name due to the app showing the driver the available weeks to view, like this week and next week,etc. They know the week numbers. So the driver may be viewing the pdf. (its on our server at the client site).
The clients employees can also view and open the files.
Yes, we preferred to have different file names for obvious reasons, but would not work with the 3rd party in order for them to show only a specific file name on the driver logins.
Thought that maybe trying to delete the file prior to saving the new one, then checking to see if it still existed, but it caused it to be worse. Get a similar error when deleting using xbase, although we may be able to try deleting using a RUN command, then if its still there it would just go to the next driver.
Not a big deal right now as it does not happen very often, just looking for best method.
Thanks
Fred
The clients employees can also view and open the files.
Yes, we preferred to have different file names for obvious reasons, but would not work with the 3rd party in order for them to show only a specific file name on the driver logins.
Thought that maybe trying to delete the file prior to saving the new one, then checking to see if it still existed, but it caused it to be worse. Get a similar error when deleting using xbase, although we may be able to try deleting using a RUN command, then if its still there it would just go to the next driver.
Not a big deal right now as it does not happen very often, just looking for best method.
Thanks
Fred
Re: printing to pdf error
Hi,
Deleting the PDF when it is open won't work. I just tried in Explorer and even a rename isn't possible when the PDF is open.
Seems to me that the only solution is to check if it is open and if so don't create the new file. In the next cycle after an hour try it again. Or create the files with another name. Put this in some queue a try it after some time if you can replace the old file with the new one.
Deleting the PDF when it is open won't work. I just tried in Explorer and even a rename isn't possible when the PDF is open.
Seems to me that the only solution is to check if it is open and if so don't create the new file. In the next cycle after an hour try it again. Or create the files with another name. Put this in some queue a try it after some time if you can replace the old file with the new one.