Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
selectDocument return 0 |
Post Reply
|
| Author | |
bart_bender
Beginner
Joined: 04 Oct 11 Location: Spain Status: Offline Points: 17 |
Post Options
Thanks(0)
Quote Reply
Topic: selectDocument return 0Posted: 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 |
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
bart_bender
Beginner
Joined: 04 Oct 11 Location: Spain Status: Offline Points: 17 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
bart_bender
Beginner
Joined: 04 Oct 11 Location: Spain Status: Offline Points: 17 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store