printing to pdf error

This forum is for eXpress++ general support.
Post Reply
Message
Author
omni
Posts: 554
Joined: Thu Jan 28, 2010 9:34 am

printing to pdf error

#1 Post by omni »

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

User avatar
rdonnay
Site Admin
Posts: 4804
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: printing to pdf error

#2 Post by rdonnay »

Fred -

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.

User avatar
Tom
Posts: 1230
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: printing to pdf error

#3 Post by Tom »

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."

User avatar
rdonnay
Site Admin
Posts: 4804
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: printing to pdf error

#4 Post by rdonnay »

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.
The eXpress train is coming - and it has more cars.

omni
Posts: 554
Joined: Thu Jan 28, 2010 9:34 am

Re: printing to pdf error

#5 Post by omni »

From windows. "file is open and cannot be created" when it tries to write the pdf. Then a retry or cancel

Wolfgang Ciriack
Posts: 484
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: printing to pdf error

#6 Post by Wolfgang Ciriack »

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

User avatar
rdonnay
Site Admin
Posts: 4804
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: printing to pdf error

#7 Post by rdonnay »

"file is open and cannot be created"
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.
The eXpress train is coming - and it has more cars.

omni
Posts: 554
Joined: Thu Jan 28, 2010 9:34 am

Re: printing to pdf error

#8 Post by omni »

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

skiman
Posts: 1198
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: printing to pdf error

#9 Post by skiman »

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.
Best regards,

Chris.
www.aboservice.be

Post Reply