My requirement is I have to convert office docs to pdf and merge the pdf then I have to create book mark with the document name.Everything going good except the one that is bookmark that I have created is not exactly pointing to starting page of the document.It is somewhere going in the middle of the page rather than pointing to start of the page.How to fix this??your help will be much appreciated.Thank you.
Could you please update on this issue…
Hi
Anand,
Hi Anand,
Thank you for you reply…yeah for me too bookmark works fine if I am in the start of the page.But it when I scroll down some where to the middle of the page and if i click the book mark again then it is not going to start of the page!!Is that behavior of pdf viewing application??Is it possible to adjust the display default to ‘Zoom - Page Fit’ rather than ‘Zoom page-width’???
Hi I don’t think that it is fault of pdf viewing application.If I am in middle of page and click the book mark then it should go to the start of the page of that book mark right??Please help to fix this…
Please refer the below pdf book mark.I have downloaded and changed the property to zoom fit width.But the bookmarks works fine it seems…
http://www.sitextools.com/samples/eBooks/eBook.pdf
Hi Anand,
logged this requirement in our issue tracking system under New Features list as
<span style=“font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
“Arial”,“sans-serif”;mso-fareast-font-family:SimSun;mso-fareast-language:ZH-CN”>PDFKITJAVA-33224. We will investigate this issue in details
and will keep you updated on the status of a correction.
<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;mso-fareast-font-family:
SimSun;mso-fareast-language:ZH-CN”>
<o:p></o:p>
Hi.Thank you for your help on this issue.I just wanted to know one more thing whether it is possible to set the Zoom to page level instead of Zoom to Fit Width in the generated PDF??
Hi Anand,
Hi,
Could you please update on this issue?
We have a release this week using ASPOSE tool .It would be better if you fix this issue soon.The book mark should work as expected.Our release is getting delayed due to this.Please fix this issue ASAP.
Thank you.
--Anand
Hi Anand,
Thanks for your patience.
Our development team is further investigating this problem but I am afraid its not yet completely resolved. In fact the team has been busy resolving other priority issues and this problem will be fixed on its schedule. Nevertheless, if you wish to get this problem resolved earlier, you may consider subscribing for Enterprise or Priority Support. Please note that the issues logged under Enterprise or Priority support have high precedence in terms of resolution as compare to issues logged with normal priority. Please visit the following link for further details on various Paid Support Services models.
Besides this, I have also inquired the current ETA from development team (without Enterprise or Priority support levels). We are sorry for this delay and inconvenience.
Hi Anand,
String path = “D:\Temp\”;<o:p></o:p>
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(path + "PdfViewerPreference_Changed_out.pdf");
//Editing existing bookmark
OutlineItemCollection pdfOutline = pdfDocument.getOutlines().get_Item(1);
pdfOutline.setDestination(
// 1st variant
// new FitVExplicitDestination(pdfDocument.getPages().get_Item(1),0)
// 2nd variant. You can tweak using the bookmark links using different parameters of ExplicitDestinationType
ExplicitDestination.createDestination(pdfDocument.getPages().get_Item(1),
ExplicitDestinationType.FitH,
new double[] {
pdfDocument.getPages().get_Item(1).getMediaBox().getHeight() }));
pdfDocument.save();
also please note that while creating a new bookmark, it is able to set the destination page number and specific position on the page:
[Java]
String path = "D:\\Temp\\";
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(path + "PdfViewerPreference_Changed_out.pdf");
OutlineItemCollection pdfOutline_new = new OutlineItemCollection(pdfDocument.getOutlines());
pdfOutline_new.setTitle("Test bookmark");
pdfOutline_new.setItalic(true);
pdfOutline_new.setBold(true);
//set the destination page number and position
pdfOutline_new.setAction(new com.aspose.pdf.GoToAction(new FitVExplicitDestination(pdfDocument.getPages().get_Item(2), 0)));
//add bookmark in the document's outline collection.
pdfDocument.getOutlines().add(pdfOutline_new);
pdfDocument.save();
You can also set specific ViewerPreference in this way:
[Java]
com.aspose.pdf.facades.PdfContentEditor editor = new com.aspose.pdf.facades.PdfContentEditor();
editor.bindPdf(path + "test.pdf");
editor.changeViewerPreference(ViewerPreference.PAGE_LAYOUT_SINGLE_PAGE);
editor.save(path + "test_out.pdf");
You may consider taking a look over details extracted from Adobe Portable Document Format Version 1.3
Destination syntax
[page /XYZ left top zoom]
Display the page designated by page, with the coordinates (left, top)
positioned at the upper-left corner of the window and the contents of
the page magnified by the factor zoom. A null value for any of the
parameters left, top, or zoom specifies that the current value of that
parameter shall be retained unchanged. A zoom value of 0 has the
same meaning as a null value.
[page /Fit]
Display the page designated by page, with its contents magnified just
enough to fit the entire page within the window both horizontally and
vertically. If the required horizontal and vertical magnification factors
are different, use the smaller of the two, centering the page within the
window in the other dimension.
[page /FitH top]
Display the page designated by page, with the vertical coordinate top
positioned at the top edge of the window and the contents of the page
magnified just enough to fit the entire width of the page within the
window. A null value for top specifies that the current value of that
parameter shall be retained unchanged.
[page /FitV left]
Display the page designated by page, with the horizontal coordinate
left positioned at the left edge of the window and the contents of the
page magnified just enough to fit the entire height of the page within
the window. A null value for left specifies that the current value of that
parameter shall be retained unchanged.
[page /FitR left bottom right top]
Display the page designated by page, with its contents magnified just
enough to fit the rectangle specified by the coordinates left, bottom,
right, and top entirely within the window both horizontally and vertically.
If the required horizontal and vertical magnification factors are
different, use the smaller of the two, centering the rectangle within the
window in the other dimension.
[page /FitB]
(PDF 1.1) Display the page designated by page, with its contents
magnified just enough to fit its bounding box entirely within the window
both horizontally and vertically. If the required horizontal and vertical
magnification factors are different, use the smaller of the two,
centering the bounding box within the window in the other dimension.
[page /FitBH top]
(PDF 1.1) Display the page designated by page, with the vertical
coordinate top positioned at the top edge of the window and the
contents of the page magnified just enough to fit the entire width of its
bounding box within the window. A null value for top specifies that the
current value of that parameter shall be retained unchanged.
[page /FitBV left]
(PDF 1.1) Display the page designated by page, with the horizontal
coordinate left positioned at the left edge of the window and the
contents of the page magnified just enough to fit the entire height of its
bounding box within the window. A null value for left specifies that the
current value of that parameter shall be retained unchanged.