Print Page | Close Window

SaveToFile Returns Success but there's no PDF File

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2118
Printed Date: 20 May 25 at 6:19AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: SaveToFile Returns Success but there's no PDF File
Posted By: DevGuy
Subject: SaveToFile Returns Success but there's no PDF File
Date Posted: 26 Jan 12 at 9:16PM
Hi All,
 
We're using the ActiveX edition of QuickPDF in a VB6 application that generates some reports.
 
Our routine generates a simple report per the following pseudo-code -
 
  Dim QP As QuickPDFAX0813.PDFLibrary
  Set QP = CreateObject(ClassName)
  If (QP.UnlockKey(<OurKey>) <> 1) Then Exit Sub
    <Do our fancy report generation stuff here e.g. QP.DrawText(100, 500, "Example: Hello World")>
  QP.SaveToFile(<OurPath>\Output.pdf")
 
We incorporated the distribution of the "quickpdfax0813.dll" file in our program's installer (MSI), and set it to self-register the DLL.
 
When we deploy and run the program on Windows XP or Windows Server 2003, the pdf gets generated without a problem.
 
When we deploy and run the same program on Windows Server 2008, the PDF seems to get generated but there is no PDF file to be found on the file-system.
 
We temporarily used MsgBoxes to indicate progress within the PDF generation functions, and they indicate that the entire PDF generation process succeeded, including the "SaveToFile" function returning "1" for success.
 
The fact that we're getting a "1" return value for "SaveToFile" in addition to indcating that the file was geneated, also indicates that the ActiveX was registered properly, so one could rule out registration related issues.
 
However' there's no PDF file to be found in the expected location!!!
 
We would really appreciate some assistance in this regard.
 
Thanks much!
-M



Replies:
Posted By: Rick_Dev
Date Posted: 30 Jan 12 at 6:56PM
what is your output path?
Any chance you are running on Vista or above and trying to save to the program files folder?

Just a thought.

Rick


Posted By: AndrewC
Date Posted: 25 Jun 12 at 12:32PM
I know that Windows 7 doesn't allow files to be saved in certain directories including Program Folders, root directories eg C:\    

Usually the current directory is set to be the same directory as the the EXE file.  You can use functions such as GetCurrentDirectory to determine where the files will be saved.

Andrew.



Posted By: barqyDev
Date Posted: 27 Jun 12 at 5:08AM
Frequently  
C:\Users\Username\AppData\Local\VirtualStore\Program Files\<username>\
for VB6, you can probably use  environment variables to determine where to save files
If none of the above-mentioned options are available, use the environment variable:
  • %ALLUSERSPROFILE% – Shared program data directory for all users
  • %LOCALAPPDATA% – Per-user program data directory (non-roaming) - Windows Vista or later
  • %APPDATA% – Per-user program data directory (roaming) - Windows Vista or later

FROM HERE: 
http://windowsteamblog.com/windows/b/developers/archive/2009/08/04/user-account-control-data-redirection.aspx - http://windowsteamblog.com/windows/b/developers/archive/2009/08/04/user-account-control-data-redirection.aspx



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk