Messages posted by akreienbring
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icesoft.org  [Login] Login 
Messages posted by: akreienbring  XML
Profile for akreienbring -> Messages posted by akreienbring [6]
Author Message
I think I have to say.... "sorry"!

My fault. Forget the whole thing. I simply excluded the last page from the search :-((

BUT: At least I found another one:

In such a PDF Doc highligthing is not working very well.
And this time I double checked by using the ICEpdf viewer before posting. ;-)

I will post you an example as soon as I have a document without any sensible data.



André
Hi,

I have PDF documents that were created by using an SCAN / OCR App. This App puts the Text under the Image. This way the PDF looks like the original, scanned Doc but can be searched.

At least in theory. Because I just discovered that I get no hits when I use the DocumentSearchController of ICEpdf (4.0) . :-(

Of course I testet the search with Acrobat Reader. Just to make sure that there's nothing wrong with the PDF Doc. ;-) And guess what... I get all the hits that I need.

What the heck...

André
Little but important correction:

Even if the ViewMode is ONE_COLUMN_VIEW the WordText can not always be highlighted :-(

I could not find reasons for it, but it seems to be related to the page that is the current page when the search is started.

By the way: How can I ensure that a given WordText is visible (is scrolled to the viewport...)?

I tried .scrollRectToVisible(wordText.getBounds().getBounds()) on the ViewContainer, but that doesn't seem to work.

André
First of all: This is a cool new feature. Thanks for implementing it ;-)

But I may have found a litte bug and want to report it here.

I'm using search highlighting in my Viewer the following way:

While searching (over all pages) I create a preview of every hit by using the LineText Object. Then I put the preview and the hit, that is the WordText Object, in a List of search results for later usage.

Hightlighting works very well and all hits in the document are highlighted.

The preview snippets can be navigated by the user. If the user clicks on the snippet I want all hightlights to disappear and only the clicked WordText to be highlighted again. When the user clicks on another snippet, again I want the previous hightlight to disappear and the hit to be hightlighted.

I discovered a few strange things in this situation.

1.
DocumentSearchController.clearAllSearchHighlight() does not remove highlights that were set by using wordText.setHighlighted(true). Okay... this could be a feature :-)

2.
So I loop over all stored WordText Objects and call
Code:
 wordText.setHighlighted(false);
 


to remove the highlights manually. But NOT ALL Highlights can be removed! There was allways one remaining.

3.
Strange enough: Using .clearAllSearchHighlight AND manual removing in combination seems to work.

4.
As the hits can be located on different pages I navigate the SwingController and setting the highlight by calling
Code:
 controller.showPage;
 wordText.setHighlighted(true);
 

This works fine if the ViewMode is ONE_COLUMN_VIEW but NOT in ViewMode ONE_PAGE_VIEW. In this case the Word on the new page simply isn't highlighted. Repainting the ViewContainer does not help. However, if the page does not change the highlighting works fine.

At this point it may be useful to know that the Viewer is embedded in an SWT Application by using the SWT_AWT Bridge and this code.
Code:
 JScrollPane pdfDocument = (JScrollPane)viewController.getViewContainer();
 


This may bring some event issues, but everything else works just well and I do not believe that that is the reason of the behaviour.

André


Looking into the source code I figured out this code that is working for me:
Code:
 Destination destination = item.getDest();
 if(destination == null){
 	// capture the action if no destination is found and point to the
 	// actions destination information
 	if (item.getAction() != null) {
 		Action action = item.getAction();
 		if (action instanceof GoToAction) {
 			destination = ((GoToAction) action).getDestination();
 		} else {
 			Library library = action.getLibrary();
 			Hashtable<Object,Object> entries = action.getEntries();
 			destination = new Destination(library, library.getObject(entries, "D"));
 		}
 	}
 }
 


In the Class OutlineItem the destination is calculated like this:

Code:
         if (dest == null) {
             // grab the Destination attribute
             Object obj = library.getObject(entries, "Dest");
             if (obj != null) {
                 dest = new Destination(library, obj);
             }
         }
 


That means: we need to use the action to get the destination if it is null by retrieving it from OutlineItem.


Hello,

I'm facing the same problem. For one PDF it seemed that only the top level OutlineItems (NOT the root item but one level below it) had no destinations.

But testing another PDF showed that this was not the reason because the top level destinations were not null.

It just seems that under some circumstances the Destination can not be calculated.

Does anyone have a solution for this? If needed I can attach the PDF in Question.
 
Profile for akreienbring -> Messages posted by akreienbring [6]
Go to:   
Powered by JForum 2.1.7ice © JForum Team