Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Feb 2010
    Location
    Denver, CO
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PDF995 (Access 2002)

    I am looking for some help from the few of you who have experience printing to PDF995 through code. I've reviewed all the threads and didn't find one to specifically answer my needs.

    My users are needing to save a report to PDF format for email purposes. I want to save the PDF file to a specific filename and path based upon variables I'm already using in the report. Sounds easy enough so far.

    I have PDF995 and PDFEdit995 installed. According to the PDF995 people, I have configured PDFEdit995 with Option #3 for the Autoname. This should allow me to edit the INI file (manually or through code) to bypass the Save As dialog box. To make this just that much more interesting, this is sitting on a Citrix server.

    The procedure I've written for altering the INI file has been attached. I include it in case someone else is trying to do this. As far as I can tell, it works well.

    However, when I run the report, which has its printer set to PDF995, the Save As dialog box appears. Save As should be bypassed and the path and filename taken from the INI file. Interestingly, though, the dialog box appears immediately upon opening the report. The report takes about 45 seconds to complete, and it runs in the background behind the Save As dialog box. If I do nothing with the dialog box, it goes away on it's own and no PDF file is written anywhere. If I supply a name to the Save As dialog box, a PDF file is created, but with data from the last time the report was run. And again, no PDF file created with the new data.

    Changing the procedure that prints the report to acViewPreview instead of acViewNormal, sends the report to the screen with the correct data. Something's not right with this, but I don't know what.
    Attached Files Attached Files

  2. #2
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PDF995 (Access 2002)

    Do you still have the FileSystemObject running in the background ie, saving the report parameters from the last session.

    Have you tried :

    <pre>set fso = nothing</pre>

    or <pre>set ts = nothing</pre>

    at the end of the routine.

    Not sure if this is the problem but worth looking at.

    Personally I've looked at freePDF but prefer CutePDF Printer which has now changed to
    CutPDF Writer.

    Hope this helps a little, I'm sure some-one will pick up on this.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: PDF995 (Access 2002)

    Why are you creating the INI file on the fly?
    I have used PDF995 and have not had the need to create the INI file on the fly.

    What is in your INI file after you create it?

  4. #4
    2 Star Lounger
    Join Date
    Feb 2010
    Location
    Denver, CO
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PDF995 (Access 2002)

    I am needing to control the name of the PDF file and where it will be saved to, based upon some variables that are not set until runtime. My boss wants to bypass the Save As dialog box. Therefore, I need to programatically pass the filename and the path to PDF995. As far as I know, the INI file is the only way to do this. If you have any other ideas, I would be grateful.

    Randy

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: PDF995 (Access 2002)

    What is in your INI file after you create it?

    The dialog box will spring up when the line DOCUMENT NAME= has nothing after the = sign.

    Maybe you are creating the INI file too late.

  6. #6
    2 Star Lounger
    Join Date
    Feb 2010
    Location
    Denver, CO
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PDF995 (Access 2002)

    I have made some slow progress with this problem. I no longer get the Save As dialog box, but I'm getting some pretty weird behavior.

    If I bypass the Save As dialog box, I will get a pdf file saved as the name I intended, but the data will be wrong. Usually it is the data from the most previous running of the report. (I can specify which client to report on at runtime). It is like there is a old temp file somewhere that is being read into the "new" file--or something. The really strange this is that if I change the report page setup dialog box and specify an actual physical printer (and that is the only change I make), the report run fine and returns the expected data.

    Another strange behavior: Set the PDF writer to show the SaveAs dialog box in order to type in my own filename. As the dialog box is on the screen, I can see the report running in the status bar in the background. I have yet to be able to get a PDF file saved to disk using the Save As dialog box. Entering a filename and clicking OK makes the dialog box go away and the report continues to run, but a file is not saved. If I do nothing with the dialog box, it disappears on its own once the report is nearing the end of its run. Again, no file is saved to disk.

    So I set a breakpoint at the beginning of the report being run just to check to see what is happening when. When I get to the line to actually open the report object, I immediately get the Save As dialog box and the rest of the code continues, instead of line by line like it should. Any thoughts on all this. I am about to give up on PDF995.

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: PDF995 (Access 2002)

    I'm not too sure if you can create the INI file on the fly. I have had a look at the c:PDF995RES folder on my PC and I notice a couple of files in there that reference the output filename etc, these files are PDF995.INI and 995.BAT, there is also a file called pdfsync.ini of which I have no idea what the function is.

    Why not have the one folder for all these files and append the USER name at the front of each PDF filename created.

  8. #8
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Leuven, Vlaanderen, Belgium
    Posts
    322
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Re: PDF995 (Access 2002)

    For future reader's reference, I add here some links to the PDF995 site. I'm not sure whether the discussion above already uses/is based on this info or whether it could have been solved with it - I didn't have time to master this (old) thread's content in depth - but this seemed nice to add...

    Along with their general FAQ PDF995 provides some useful VBA coding tips under theirDeveloper's FAQ page, e.g. VBA code that successfully converts an Access report to a PDF file.. At first sight, the save as dialog, the created pdf's location and filename are set through editing the pdf995.ini.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •