Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).

New Forum | Previous | Next | (P-PDF) Developers

Topic: causes of file read errors from avdoc?
Conf: (P-PDF) Developers, Msg: 52228
From: julia
Date: 5/29/2002 04:50 PM

I have a vb app which prints a report to distiller in order to convert it to pdf and then uses av and pddoc methods to append other similarly created pdf documents to the first one. Unfortunately it isn't as stable as i would like it to be. It seems as if calls to CreateObject aren't always working, but I'm not sure also even after I've called the exit method of the exchange object and closed all of its open windows i'll notice inside the NT task manager that the Acrodist.exe is still running. I don't know how to handle this error b/c sometimes if i simply restart my application I don't get all of the pages I'm supposed to get in the pdf. Here is some of my code:

If star Or core Then
file1 = "a" 'participant report
file1pdf = PRINTER_DEFAULT_PDF_NAME & "a.pdf"
WriteReport projid, file1
WaitForFile (file1pdf)
Set AVDoc1 = CreateObject("AcroExch.AVDoc")
AVDoc1.Open file1pdf, "Doc1" 'file1pdf did'nt get made/saved under that name
Set PDDoc1 = AVDoc1.GetPDDoc
ok = PDDoc1.Save(PDSaveFull, "c:\acrotest.pdf")
If Not ok Then
Debug.Print "problem with pddocsave"
End If
my problem always seems to occur in the call to PDDoc save, which leads me to believe the CreateObject isn't working. The type of error I usually get are "file read error" or files doesn't exitst from Acrobat followed by Vb runtime error saying "object variable or with block variable not set.." It was suggested to me to just try using the PDDoc as you can test for its success or failure better like this:
set pddoc = CreateObject("AcroExch.PDDOC")
if pddoc.Open "my file" then
pddoc.Save1, "my file"
debug.print "problem"
end if
But my app never even got off the ground with this -- I'd immediately get the file read error or the file doesn't exist error. Please anybody help.

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.