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!
![]() |
Get page count without open file |
Post Reply ![]() |
Author | |
ergadita ![]() Beginner ![]() Joined: 15 Feb 21 Location: Spain Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() Posted: 15 Feb 21 at 6:11PM |
Hi, i need to know how much pages has a file without open it.
To extract a page without open the file is the function ExtractFilePages.
The function PageCount needs to open the file previously. is there any function that returns the pages number of a file without open it? Thanks & Best regards. |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3296 |
![]() ![]() ![]() ![]() ![]() |
Hi Juan :)
for some functions there are versions without have to load the pdf but regarding PageCount this isn't so. I understand that you want to know before really opening a file how large it is. An experimental idea: The pagecount is directly visible in the pdf-content. You can try it even with Notepad ;-) Below i've made few samples to show you how to detect these data. You'll find this data after: /N /Count and /Type/Catalog/Pages Cheers and welcome here, Ingo // here it's 5432 pages... %PDF-1.6 %âãÏÓ 55528 0 obj <</Linearized 1/L 110150031/O 55530/E 491335/N 5432/T 110109414/H [ 529 55325]>> endobj 55547 0 obj //here it's 5 pages... 5 0 obj << /Count 5 /Kids [ 9 0 R 19 0 R 25 0 R 37 0 R 50 0 R ] /Type /Pages >> endobj //here it's 2 pages... 1 0 obj <</Type/Catalog/Pages 2 0 R /AcroForm<</Fields[]>>>> endobj //here it's 2 pagesas well... 1 0 obj << /Type /Pages /Count 2 /Kids [72 0 R 83 0 R ] >> endobj //here it's 64 pages... 974 0 obj << /Linearized 1 /O 976 /H [ 931 1410 ] /L 5645529 /E 31260 /N 64 /T 5625930 >> endobj Edited by Ingo - 15 Feb 21 at 7:02PM |
|
Cheers,
Ingo |
|
![]() |
|
ergadita ![]() Beginner ![]() Joined: 15 Feb 21 Location: Spain Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Hi Ingo, thank you so much for answer as soon.
If not exists any function that returns the pages number without open the file, i will use LoadFromFile function and then the PageCount function. i will buy this sdk and i hope that in the next release comes with this function. Best regards |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3296 |
![]() ![]() ![]() ![]() ![]() |
Hi Juan :)
uuuups... I'm wrong. Never used it but here's the function you're asking for: https://www.debenu.com/docs/pdf_library_reference/DAGetPageCount.php This will feed your needs. DA means direct access without loading. What you really should avoid is mixing direct access with normal functions - this won't work. |
|
Cheers,
Ingo |
|
![]() |
|
ergadita ![]() Beginner ![]() Joined: 15 Feb 21 Location: Spain Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Oleeeeeeeeee
Then i must use first DaOpenFile, this function returns a file handled than i can use with DaPageCount. Can i do so? QP = New PDFLibrary("DebenuPDFLibraryDLL1811.dll") If QP.UnlockKey(LicenseKey) <> 0 Then Dim fileHandle As Integer = QP.DAOpenFile(fileName, password) Dim pageCount As Integer = QP.DAPagecount(fileHandle) QP.DACloseFile(fileHandle) For Page As Integer = 1 To pageCount Dim Texts As String = QP.ExtractFilePageText(fileName, password, Page, 8) If Texts.Contains(searchvalue) Then QP.ExtractFilePages(fileName, "", OutputFileName, Page) End If Next
endif |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3296 |
![]() ![]() ![]() ![]() ![]() |
Hi Juan,
never mix DA and non-DA in one thread. After QP.DAClose... you should insert a QP.Free. Then a new QP = New... Then Unlock and then Extract and then Free again. Here'sa sample about using DA-functionality: https://www.debenu.com/kb/programmatically-render-pdf-files-in-windows-forms-with-net-and-c/ |
|
Cheers,
Ingo |
|
![]() |
|
ergadita ![]() Beginner ![]() Joined: 15 Feb 21 Location: Spain Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Hi Ingo,
I will do that. Thanks & Best Regards
|
|
![]() |
|
ergadita ![]() Beginner ![]() Joined: 15 Feb 21 Location: Spain Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Hi Ingo, i have finished the app, and runs ok in my computer in a executable file, but i need to put in our server like a webservice in IIS into a DLL, but the license not run in the DLL, UnlockKey function returns 0, where is the problem. I need to test in the server before i purchase it. Thanks & Best Regards
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3296 |
![]() ![]() ![]() ![]() ![]() |
What is LastErrorCode telling after UnlockKey?
|
|
Cheers,
Ingo |
|
![]() |
|
ergadita ![]() Beginner ![]() Joined: 15 Feb 21 Location: Spain Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Hi Ingo,
UnlockKey returns 0 LastErrorCode returns 0 Now, i´m thinking, is possible that may be any problem with firewall? The unlockey connects to any of your server to check licensekey? Thanks & Best Regards
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3296 |
![]() ![]() ![]() ![]() ![]() |
Hi,
i'm working with a source version (so i need no unlock-function). I don't know how the server access willbe processed. Sorry... Perhaps here's another one knowing something about these procedures. This is only a forum from users and for users. BTW: Are you sure that your license key is still valid (30 days is the limit)? Did you get any textfiles with the key included? |
|
Cheers,
Ingo |
|
![]() |
|
tfrost ![]() Senior Member ![]() Joined: 06 Sep 10 Location: UK Status: Offline Points: 341 |
![]() ![]() ![]() ![]() ![]() |
I don't think that internet access is needed to validate the key. We use a license key in lots of different EXE and DLL files at many customer sites, some of them tightly secured. and nobody has reported any block or asked for how to get past a firewall. But I have never used a trial version; it might be different.
|
|
![]() |
|
ergadita ![]() Beginner ![]() Joined: 15 Feb 21 Location: Spain Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Hi,
The license key is good because if i execute the executable file the unlock function returns 1, is the same code for dll and for exe. is there any possibility to get a temporary license key for pro version, not for trial? I sent an email to support, do you know other way to arrive to technical support? I attach a screen capture of licence key Thanks for your answers and best regards |
|
![]() |
|
ergadita ![]() Beginner ![]() Joined: 15 Feb 21 Location: Spain Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
the image not is, i can´t attach, but says this:
Trial period : Evaluation license valid until 14 March 2021. |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3296 |
![]() ![]() ![]() ![]() ![]() |
the trial version IS the pro-version... working with a testkey.
If the unlock function returns with 1 using an exe-file (don't know what exe you're meaning) then the license key is valid. If your test app doesn't work and unlock returns with 0 then there's something wrong in your sample code or the installation? There are several versions of the library... 32 and 64 bit... where is the library-dll? Perhaps you should post the code? |
|
Cheers,
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