reading several files

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

heiko22
User
Posts: 16
Joined: Thu Sep 27, 2007 10:24 am

reading several files

Post by heiko22 »

If I want to read several files including some extra large ones the program crashes. If I only read the large file, it works.

I am doing the following steps:

1. I open the file
2. I read out the bookmark and corresponding page number
3. I close the file.

I am repeating the procudure up to the last file.

The pdf-components are embedded in 4 form sheets that stay in the background when I start the program.

The task manager shows the "pdfxcview.exe" four times (memory requirement in total ca. 30 MB).

The problem occurs always with the same files. These contain about 200 pages.

I run a test reading 50 files, including twice one of the problem files, one after the other, differing in the path only. The first file of these was read in perfectly. However, the second caused the crash of the program

does anyone know why this happens?.

I include this problematic file.
You do not have the required permissions to view the files attached to this post.
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3556
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Post by Ivan - Tracker Software »

Which build do you use ?
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
heiko22
User
Posts: 16
Joined: Thu Sep 27, 2007 10:24 am

Post by heiko22 »

The latest version 1.0.28
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3556
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Post by Ivan - Tracker Software »

Can you sent me sample project which will helps me to reproduce the problem, since with my sample I cannot reproduce ?
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
heiko22
User
Posts: 16
Joined: Thu Sep 27, 2007 10:24 am

Post by heiko22 »

Hello,

I realised that the problem is related to the JavaScript Code.
The program has problems with the execute assignment.

If I use the following Code, then the program collapses with some files

Code: Select all

    jsCode = "function DumpBookmark(bkm, nLevel)"
    jsCode = jsCode & "{"
    jsCode = jsCode & "var s = '';"
    jsCode = jsCode & "for (var i = 0; i < nLevel; i++) s += ' ';"
    jsCode = jsCode & "s += '+-';"
    jsCode = jsCode & "bkm.execute(this.gotoNamedDest(bkm.name));"
    jsCode = jsCode & "s += bkm.name;"
    jsCode = jsCode & "s += '=====' + this.pageNum;"
    jsCode = jsCode & "s += '\n';"
    jsCode = jsCode & "if (bkm.children != null)"
    jsCode = jsCode & "{"
    jsCode = jsCode & "for (var i = 0; i < bkm.children.length; i++)"
    jsCode = jsCode & "s += DumpBookmark(bkm.children[i], nLevel + 1);"
    jsCode = jsCode & "}"
    jsCode = jsCode & "return s;"
    jsCode = jsCode & "}"
    jsCode = jsCode & "DumpBookmark(this.bookmarkRoot, 0);"

    Call frmVerzeichnis.PDFDateivorschau.RunJavaScript(jsCode, jsResult, DokumentenNr)
If I put in a break point and accomplish the Code per line, then files are read without problems.

When I erased the execute assignment, all files were read in properly.

Is the Code not correct?
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3556
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Post by Ivan - Tracker Software »

If you will read documentation for Bookmark.execute function, you will see that this function doesn't have parameters. It just executes action associated with this bookmakr item. Do you realy want to execute actions for all bookmarks into the document ?

Another note: document's function gotoNamedDest executed named action, but this doesn't means that the name of this action is the same (or has any relations) to the title (name) of the bookmark item. For more information about named destinations, please refer to the PDF specification.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
heiko22
User
Posts: 16
Joined: Thu Sep 27, 2007 10:24 am

Post by heiko22 »

Hello,

I have the example with the execute-assignment from an Acrobat-Reference.

I am told that this is a trick, to get page numbers of the bookmarks.
In general, the code works.
All problem-files are read in and the program does not crash.
However, I had to put in a waiting loop before the method 'RunJavaScript'.

Probably, the program crash occurred because of the following reason:

The file was opened. Then, the program tried to jump with the execute-assignment to the specific bookmark.
I suppose that at this moment the loading of the file had not been completed. That means that the program tried to jump to a bookmark that was not yet accessible.

Do you think that this might have been the reason for the program collapse?

Only in one case I had to put in a waiting loop of 35 seconds, in order to be able to read it.

Since then no further programs occur with the reading.

Do you know of any solution to avoid this waiting loop or to decrease it ?

It is quite difficult for me to solve this problem as there is hardly any German reference available.


Best regards


Heiko
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3556
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Post by Ivan - Tracker Software »

Can you send me your application/project, since I cannot reproduce the trouble here ?
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
heiko22
User
Posts: 16
Joined: Thu Sep 27, 2007 10:24 am

Post by heiko22 »

I enclose an example-file with three problem files.

Executing the program the collapse mostly occurs with the file '911cd_guide.pdf'.
Only, when I include a waiting loop of 5 seconds, all files are read in.

The file that makes the program stop, differs each time.

I tested the program on 2 different PCs. I always got the same result.

best regards


Heiko
You do not have the required permissions to view the files attached to this post.
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3556
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Post by Ivan - Tracker Software »

Can you try with the latest available build ? Here we cannot reproduce the trouble at all. Maybe you can say us more info about your comp and OS (RAM size, free disk space on the partition where temp files are located, the OS version) ?
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
heiko22
User
Posts: 16
Joined: Thu Sep 27, 2007 10:24 am

Post by heiko22 »

I thought you had found the solution of the problem, as no problem occurred after I had started working with the new version on 20-11-07 (version 1.029). I did not change anything else (configuration of the pc remained identically).

After installing the update, the program worked perfectly.


Thank you very much for your excellent support.

Best regards


Heiko
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom

Post by John - Tracker Supp »

Pleasure :)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com