HI all
I have a feature for adding bookmark to a PDF file, but I found when I click the bookmark, I cann’t located the accurate line to the content.
I tried all the destination I found, but I didn’t do it successfully. Could you give me some advice for it?
double zoom = 1;
Page item = pdfDocument.getPages().get_Item(i);
GoToAction action = new GoToAction(new XYZExplicitDestination(item, textFragment.getPosition().getXIndent(), textFragment.getPosition().getYIndent(), zoom));
// setting action to fit to page width zoom
// GoToAction actionFittoWidth = new GoToAction(new FitHExplicitDestination(item, item.getMediaBox().getWidth()));
// // setting action to fit to page height zoom
// GoToAction actionFittoHeight = new GoToAction(new FitVExplicitDestination(item, textFragment.getPosition().getYIndent()));
// GoToAction action = new GoToAction(new FitHExplicitDestination(pdfDocument.getPages().get_Item(i), textFragment.getPosition().getYIndent()));
// textFragment.getPosition().get
// GoToAction action = new GoToAction(new FitHExplicitDestination(pdfDocument.getPages().get_Item(i), textFragment.getPosition().getYIndent()));
pdfOutline.setAction(action);
// pdfOutline.setAction(new GoToAction((Document) pdfDocument.getPages().get_Item(i).getDocument(), bookmark));
// pdfOutline.setDestination(pdfDocument.getPages().get_Item(i).getDocument().getDestinations());
Thanks
Lisa