selectDocument return 0
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=1998
Printed Date: 17 Jan 26 at 9:25PM Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com
Topic: selectDocument return 0
Posted By: bart_bender
Subject: selectDocument return 0
Date Posted: 14 Oct 11 at 1:49PM
hello, I'm making a copy of a PDF Image to a new Document in VB .NET using the DLL library version in a Windows Service application
i'm opening the document as string (byte array) in a method
Private WithEvents _qp As PDFLibrary . . .
public sub new() _qp = New PDFLibrary(dllPath) _qp.UnlockKey("XXXXXXX") end sub
private function Func1 (doc as byte(), Optional ByVal password As String = "") as memorystream Dim docId As Integer docId = _qp.LoadFromString(inPdf, password) Return Func2(docId, password)
End function
private function Func2(docId as integer,password as string) as memorystream dim ret as integer dim newDoc as integer = _qp.NewDocument()
ret = _qp.SelectDocument(DocId) ' <<<<========== THIS RETURN 0 always in the service but runs correctly in a windows form application
_ end function
What am i doing bad?
Thanks in advance best regards
PD: i'm sorry for my english
|
Replies:
Posted By: Ingo
Date Posted: 14 Oct 11 at 9:31PM
What do the other functions return if it's running as a service? I think they give an error, too. Where's the dll? It should be on the same machine, path where your app is working. I think that's the problem?
Cheers and welcome here, Ingo
|
Posted By: bart_bender
Date Posted: 17 Oct 11 at 8:53AM
Hello Ingo
If i execute "ret = SelectDocument(DocId)" and "imagesFoundId = _qp.FindImages" before open the new document this runs correctly.
The problems appears when i have two documents opened.
I've debugged the service to check the path to the DLL and this is correct
Thanks in advance
|
Posted By: bart_bender
Date Posted: 17 Oct 11 at 9:19AM
I've seen my error, the DocId is invalid. I set the value from LoadFromString function, now i use the SelectedDocument function after open the document.
Thanks for your help Ingo
|
|