Print Page | Close Window

Web located PDF File not loaded

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=2474
Printed Date: 22 Nov 24 at 8:09PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Web located PDF File not loaded
Posted By: zero_g
Subject: Web located PDF File not loaded
Date Posted: 14 Dec 12 at 3:09PM
Hello,
I tried to open a web located file direct with this code.

Dim result As Boolean = CBool(QP.UnlockKey(LicenseKey))
        If result = True Then
            Dim pdf_vorlage As String = "complete link to the file"
            QP.LoadFromFile(pdf_vorlage, String.Empty)
            Dim loaded As Boolean = QP.LoadFromFile(pdf_vorlage, String.Empty)
            Dim err_code As Long = QP.LastErrorCode
        End If

Loaded returns 'false' and err_code =0.
Later I tried the direct asccess functionality, but without success. Loaded gives "false" and err_code=411 (file not found) ???

Can anybody help?

Kind regards Tom



Replies:
Posted By: tfrost
Date Posted: 14 Dec 12 at 4:25PM
LoadFromFile means 'load from a file on your local machine or network'.  In other words, the filename must start with a drive letter or with "\\servername".  To view a web file identified with a URL, you must first download it to to one of these locations, typically using http or ftp protocol, then open it with LoadFromFile.


Posted By: zero_g
Date Posted: 14 Dec 12 at 7:44PM
I want to avoid the download of each file, because I want to load a number of files from its web location and read some file informations. Is there really no chance to load directly from the web?

kind regards
Tom


Posted By: tfrost
Date Posted: 14 Dec 12 at 8:16PM
Somehow, all the bits in the document have to be moved from Timbuktu, or wherever the webserver is, into your program on your machine which is going to read the document.  Even if there was a means to 'load from the web location' this would still be happening.  If you don't want to save the document file on your local disk, that's fine, but you then have to have your FTP client download and create an in-memory stream and then use LoadFromStream instead of LoadFromFile.  Never having used Visual Basic I have no idea whether it has these capabilities, however, which is why I suggested a file transfer.  In Delphi, I would probably just use an FTP component to download the file into a MemoryStream object and load QP from that.


Posted By: zero_g
Date Posted: 16 Dec 12 at 9:53AM
yes, I see. In the meantime I developed a small codesample with download functionalit->reading the requested Informations from the files->delete the files.

kind regards
Tom



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