Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, June 18, 2007 11:51:54 AM(UTC)
dlucchese

Groups: Registered
Posts: 11


Hi

I'm currently working on annotations on PDF files. I have a performance problem to initialize the annotations file. I noticed that the XML file writes sequencially all the pages, without page numbers.

Problem: I have a PDF 110 pages long, and have only annotations on page 1 and on page 80. I have no choice but writing empty pages for page 2 to 79. Otherwise, even if I specify 'INSERTPAGE' in SaveOptions I receive an error 'PAGE NOT FOUND' when saving page 79.

As a workaround at the beginning if the annotations file does not exist I insert the first page container 110 times. It works but it takes some time (about 20 seconds). Is there is a 'Leadtools' solution for that (maybe I misunderstood the method for multipage docs) ?


Thanks in advance!

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, June 19, 2007 4:33:54 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

The workaround you created is correct, because there is no special function in LEADTOOLS to number the pages or insert 'blank' pages.

If your application faces this issue all the time, and you would like to optimize it, you could create templates of common blank-page files, such as 50, 100, 150, etc. pages, then instead of looping every time to create a new file, copy the nearest template and only loop to append the needed number of pages. For example if you need 110 pages, copy the 100-page template then loop 10 times to append 10 new pages.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Tuesday, June 19, 2007 9:28:19 AM(UTC)
dlucchese

Groups: Registered
Posts: 11


Thanks, I followed your idea about the template. I have a template with no page, and a marker. I have another template with a 'page' tag, with a container. In my application I take the empty template and add 110 times the page object.

At the beginning it didn't work. Then I noticed 3 invisible characters at the beginning of your file ( $EF, $BB, $BF ). Now I've added these values in the template; it's ok and the process lasts less than  2 secs for 110 pages.

I verified these values do not vary upon the number of pages. But is there any reason why I shouldn't build the initial XML file this way?
 
#4 Posted : Wednesday, June 20, 2007 12:20:45 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

The only thing to watch out for is that our annotations format is not publicly documented, so you should not generally modify the structure of annotations files too much, and instead should normally use LEADTOOLS functions to manipulate these files.
However, in your case, since the files you created are accepted by the toolkit, and similar to the files saved by it, there should be no problem using them.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.073 seconds.