Free Support Forum - aspose.com

Collapse bookmark tree

Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

It is possible to save an excel file in pdf format where all inserted nested bookmarks are collapsed? My report contains more then 100 bookmarks. Therefore it is often confusing to navigate through the completely expanded bookmark tree if you are looking for a determined page or part of the document.

Thanks in advance

Erik

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

Well, I am afraid your requested feature is not support with Aspose.Cells at the moment. We have added this as new feature request in our internal issue tracking system with issue id CELLSNET-13618. We will look into the feasibility of the feature and get back to you soon.

Thank you & Best Regards,

Hi,

<span style=“font-family: “Calibri”,“sans-serif”;”>Please try the attached version, you may use pdfBookmark.IsCollapsed attribute to collapse the root bookmark.<o:p></o:p>



//Instantiate a new workbook
Workbook workbook = new Workbook();
//Get the cells in the first(default) worksheet
Cells cells = workbook.Worksheets[0].Cells;
//Get the A1 cell
Aspose.Cells.Cell p = cells["A1"];
//Enter a value
p.PutValue("Preface");
//Get the A10 cell
Aspose.Cells.Cell A = cells["A10"];
//Enter a value.
A.PutValue("page1");
//Get the H15 cell
Aspose.Cells.Cell D = cells["H15"];
//Enter a value
D.PutValue("page1(H15)");
//Add a new worksheet to the workbook
workbook.Worksheets.Add();
//Get the cells in the second sheet
cells = workbook.Worksheets[1].Cells;
//Get the B10 cell in the second sheet
Aspose.Cells.Cell B = cells["B10"];
//Enter a value
B.PutValue("page2");
//Add a new worksheet to the workbook
workbook.Worksheets.Add();
//Get the cells in the third sheet
cells = workbook.Worksheets[2].Cells;
//Get the C10 cell in the third sheet
Aspose.Cells.Cell C = cells["C10"];
//Enter a value
C.PutValue("page3");

//Create a main PDF Bookmark entry object
PdfBookmarkEntry pbeRoot = new PdfBookmarkEntry();
//Specify its text
pbeRoot.Text = "Sections";
//Set the destination cell/location
pbeRoot.Destination = p;

//Set its sub entry array list
pbeRoot.SubEntry = new ArrayList();

//Create a sub PDF Bookmark entry object
PdfBookmarkEntry subPbe1 = new PdfBookmarkEntry();
//Specify its text
subPbe1.Text = "Section 1";
//Set its destination cell
subPbe1.Destination = A;
//Define/Create a sub Bookmark entry object of "Section A"
PdfBookmarkEntry ssubPbe = new PdfBookmarkEntry();
//Specify its text
ssubPbe.Text = "Section 1.1";
//Set its destination
ssubPbe.Destination = D;
//Create/Set its sub entry array list object
subPbe1.SubEntry = new ArrayList();
//Add the object to "Section 1"
subPbe1.SubEntry.Add(ssubPbe);
//Add the object to the main PDF root object
pbeRoot.SubEntry.Add(subPbe1);

//Create a sub PDF Bookmark entry object
PdfBookmarkEntry subPbe2 = new PdfBookmarkEntry();
//Specify its text
subPbe2.Text = "Section 2";
//Set its destination
subPbe2.Destination = B;
//Add the object to the main PDF root object
pbeRoot.SubEntry.Add(subPbe2);

//Create a sub PDF Bookmark entry object
PdfBookmarkEntry subPbe3 = new PdfBookmarkEntry();
//Specify its text
subPbe3.Text = "Section 3";
//Set its destination
subPbe3.Destination = C;
//Add the object to the main PDF root object
pbeRoot.SubEntry.Add(subPbe3);

pbeRoot.IsCollapsed = true;

//Set the PDF Bookmark root object
workbook.SaveOptions.PdfBookmark = pbeRoot;

//Save the pdf file
workbook.Save("e:\\test\\newwPDFBookmarks_test.pdf");



Thank you.

Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the provided fix. The new property to collapse bookmark entries works fine.

Regards

Erik

Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

The latest provided version has one little side effect. Each worksheet of my excel template contains a tiff image with a CI-specific brand logo. If I use Aspose .Cells 4.8.2.5 the background of the image is drawn black and the claim on the left side isn’t visible anymore (when I save the file in pdf format). Can you please fix this behavior? If I remove the image and insert it again the problem is solved. But with this method I have to change more than 150 worksheets.

Thanks in advance

Erik

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

We have found your mentioned issue after an initial test. We will look into it and get back to you soon. Your issue has been registered in our internal issue tracking system with issue id CELLSNET-14245.

Thank you & Best Regards,

Hi Erik, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

Please try the attached latest version of Aspose.Cells. We have fixed your mentioned issue.

Thank You & Best Regards,

Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

In the new version the MajorGridLines property of the chart object is missing. Therefore I’m unable to check whether the new versions solve the mentioned issue because I’m unable to build my project. Is this a bug?

Erik

Hi Erik, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

Chart.MajorGridLines property is obsolete now. Please use chart.Axis.MajorGridLines instead.

Thank You & Best Regards,

Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for this information. Now I was able to put the new version into work. The mentioned issue is fixed.

I’m missing the IsCollapsed property of the PdfBookmarkEntry class (introduced in 4.8.2.5). The bookmark tree is still collapsed, but I’m unable to access the property.

Thanks

Erik

Hi,

Please try:

pbeRoot.IsOpen = false; //to collapse the root bookmark in pdf.

as we have optimized some api names in the new fix.

Thank you.

Hi,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I noticed another issue with the latest Aspose.Cells version. The size of the chart in excel doesn’t fit the size of the chart in the pdf file (it appears shrunken)

Would it be possible to fix this by next Monday morning <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />8:00 o’clock? This problem didn’t appear in the last two beta versions.

Thanks in advance

Erik

Hi,

Yes, we noticed the plot area in the pdf file is a bit shrunken with the new fix v4.8.2.6, but I think the difference is subtle. We will definitely check the issue soon.

I am afraid the issue might not be fixed on coming Monday (as per your demand) this time because our main chinese developers for the Chart-to-Image and Xls2Pdf features are on leave (of one week) for their spring festival.

Thanks for your understanding!

Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I think that a reduction of 30% isn’t subtle. But I’m optimistic that you will fix this issue within the next weeks. By then I will use an older version to overcome the issue

Nevertheless, thank you for the reply.

Erik

Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

When will you fix this issue? It is the final step to finish the automation process of our reporting system. Right now we can just create the excel files and process them with Adobe Acrobat. Especially the reassigning of bookmarks to pages and the re-establishment of the bookmarks order is annoying (if you have to process more then 100 bookmarks in each document and if you know that aspose would do this job without any human interaction)

Thanks in advance

Erik

Hi Erik,

We have further investigated your issue. Could you elaborate where does the plot area shrunken (you may encircle the areas - thanks). You said it is 30% shrink. We think it is 2 - 3%. Kindly post some more sample files (input excel files and output pdf files) to show the issue. We will check your case soon.

Thank you.

Hi <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

please find attached the required sample files.

- example.xls : basic excel input file

- reportAspose.xls : processed excel file (using Aspose.cells), input for both created pdf files

- reportAspose.pdf : pdf report created using Aspose.Cells

- reportAdobe.pdf : pdf report created using Adobe Acrobat

- sourcecode.txt

Please print out the two pdf files and compare the results. I don’t think that it is necessary to point out the difference because it is obvious. I know that Aspose created the same results as Adobe one ore two versions before the latest version.

If you need further information please let me know.

Regards

Erik

Hi Erik,

I have tested your code with your template file using the attached latest version v4.8.2.8, I think the plot area has same height width comparing it with Adobe report. Could you try it and let us know about it.

I have also attached my output pdf file using the version v4.8.2.8. It is not shrinked similar to your provided reportAspose.pdf file.

Thank you.

Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

The provided pdf file looks fine. But I’m unable to reproduce the result on my pc. I tried my application with Aspose.Cells. 4.8.2.8 (before I used 4.8.2.6) but I had no luck. I also checked this on different clients. On those clients where I used an older version of the application before, I got always the same result. But on those clients where I installed the application the first time, I got the correct result. Maybe I have to delete all my old Aspose files and try it again.

Erik

Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I removed each single aspose installation on my pc and I also deleted any file where the filename matches the pattern aspose*.*. After a restart I installed Apspose.Cells 4.8.2 (msi file). But the issue is still there. Do you have an idea how to fix this?

Erik