Page 1 of 1

Strange error creating PDF files

Posted: Wed Oct 10, 2012 6:48 pm
by sstone
I have been having a persistent error when using the DCPRINT ON command with the ACROBAT clause to generate several pdf files consecutively. The most common error is "Error Base/2266 Receiver of message is not an object:Atsay". I have also got on some occasions "Error copying document to destination file". I have created a small program to simulate what is happening in my application and have discovered that the error condition seems to have something to do with the rate at which the files are being generated. I have used the SLEEP(100) command in the demo program to overcome this error but have not been successful when applying this approach in the actual application.

Additionally, the file is still generated in spite of the error when BREAKing out of the error message. You will notice too in the sample that without the SLEEP command, some files may be skipped without generating an error. In short the results are variable.

Is there something happening behind the scenes which may be responsible for this strange behaviour?

S Lorde

Re: Strange error creating PDF files

Posted: Wed Oct 10, 2012 7:34 pm
by bwolfsohn
I've had to put a sleep in at certain points in our software when creating pdf files. in our case, we tested for the existence of the filename in a do while !fexists() before continuing.

xbase++ is probably going faster than the filesystem..

Re: Strange error creating PDF files

Posted: Thu Oct 11, 2012 5:41 pm
by sstone
I am using a similar approach - trying to slow down the generation of the pdf and testing for its existence before continuing but the 'Receiver of message is not an object:AtSay' error occurs almost immediately after the DCPRINT ON command while a simple @ row, col DCPRINT SAY line is being executed. I was wondering if there is another way to force the writing of pdf file apart from using DCPRINT OFF PRINTER oPrinter.

What makes this problem particularly difficult to track down is its inconsistency. The error does not occur with the creation of each file and the file is generated in spite of the error. Is it possible that it is a synchronisation problem between Xbase and the Bullzip driver?

S Lorde

Re: Strange error creating PDF files

Posted: Mon Oct 15, 2012 6:48 am
by rdonnay
Have you tried putting a Sleep(100) in your code after the DCPRINT ON command?

Re: Strange error creating PDF files

Posted: Mon Oct 15, 2012 3:37 pm
by Auge_Ohr
hi,

what ACROBAT Version are you using ?
there are some Version ( e.g. 9.3 / 10 ) which does not work correct with OCX.
if you are using lates "Adobe Reader XI (11.0)" try Alaska Demo Sample if it run before run Express++

Re: Strange error creating PDF files

Posted: Mon Oct 15, 2012 7:17 pm
by bwolfsohn
Auge_Ohr wrote:hi,

what ACROBAT Version are you using ?
there are some Version ( e.g. 9.3 / 10 ) which does not work correct with OCX.
if you are using lates "Adobe Reader XI (11.0)" try Alaska Demo Sample if it run before run Express++
I don't think the problem is with the version of acrobat.. If you re-read the original message, the problem occurs when several pdfs are generated consecutively. there is no problem with individual pdf's..

Re: Strange error creating PDF files

Posted: Wed Oct 17, 2012 6:38 pm
by sstone
Roger,

I have placed the SLEEP(100) after the DCPRINT ON. I have also tried it at other points and have also increased the sleep time. The results are pretty much the same. It generates about three files and then produces the aforementioned error. I do not think it has anything to do with the version of acrobat. When a single file is required it creates it without error. The issue surrounds the generation of several files consecutively.

S Lorde

Re: Strange error creating PDF files

Posted: Thu Oct 18, 2012 12:20 am
by skiman
Hi,

Put a sleep(100) or higher between each document or after each dcprint OFF.

It's just a timing issue. Xbase is sending too fast to the printer driver. I you would printing 10 different Word document to the driver in a few seconds, it would also have the same problem.