We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert word styles to pdf bookmarks with Track changes

I am using trial version of Aspose and now I got two queries before purchasing it. Please help me out on these:

1: I want to convert word styles to pdf bookmarks. Is it possible with this API?

2: Word’s track changes are ignored by Aspose.word while converting document from word doc to PDF. Is this feature available in this API?

Hi Chandan,

Thanks for your inquiry.
chandanluthra:
1: I want to convert word styles to pdf bookmarks. Is it possible with this API?
Please use the PdfSaveOptions.setHeadingsOutlineLevels method to specify how many levels of headings (paragraphs formatted with the Heading styles) to include in the PDF document outline.
http://www.aspose.com/docs/display/wordsjava/PdfSaveOptions

Document doc = new Document(getMyDir() + "Rendering.doc");

PdfSaveOptions options = new PdfSaveOptions();

options.setHeadingsOutlineLevels(3);

options.setExpandedOutlineLevels(1);

doc.save(getMyDir() + "Rendering.SaveToPdfWithOutline Out.pdf", options);

chandanluthra:
2: Word's track changes are ignored by Aspose.word while converting document from word doc to PDF. Is this feature available in this API?
Unfortunately, Aspose.Words does not support the requested feature at the moment. However, we had already logged this feature request as WORDSNET-2120 in our issue tracking system. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

Here are few more queries regarding this thread.

  1. Can I convert custom styles to PDF bookmarks?
  2. If I set outline level of custom style (like Subsection) with same level as of heading then does it get converted to bookmark in PDF with code snippet mentioned by you?
  3. Also, when I use the code snippet mentioned in your previous post, I saw weird behavior with headings. I set <span style=“font-size:
    10.0pt;font-family:“Courier New”;mso-no-proof:yes”>options.setHeadingsOutlineLevels(1) and instead of heading(which has level 1), other style with level 1 gets bookmarked in PDF.

Help me out on this and let me know if I am making any mistake.

Hi Chandan,

Thanks for your inquiry. There is no direct way to convert the custom styles to PDF bookmarks. However, you can achieve your requirements adding bookmarks for text/paragraphs which uses the customer styles. Please see the following code snippet for your kind reference.

The setHeadingsOutlineLevels and setExpandedOutlineLevels are obsolete now, Please use the OutlineOptions class to specify outline options like HeadingsOutlineLevels, ExpandedOutlineLevels, BookmarksOutlineLevels. Following are the details.

BookmarksOutlineLevels : Allows to specify individual bookmarks outline level.
DefaultBookmarksOutlineLevel : Specifies the default level in the document outline at which to display Word bookmarks.
ExpandedOutlineLevels : Specifies how many levels in the document outline to show expanded when the file is viewed.
HeadingsOutlineLevels : Specifies how many levels of headings (paragraphs formatted with the Heading styles) to include in the document outline.


The following code example insert bookmark at each Paragraph (with custom style) and export individual bookmark with outline level in PDF file. Hope this helps you. Please let us know if you have any more queries.


// Use a blank document

Document doc = new Document();

//Add custom style

Style style = doc.getStyles().add(StyleType.PARAGRAPH, "CustomStyle");

style.getFont().setUnderline(Underline.SINGLE);

style.getFont().setSize(20);

// Create a document builder to insert content with into document.

DocumentBuilder builder = new DocumentBuilder(doc);

builder.getParagraphFormat().setStyle(style);

builder.writeln("Text 1");

builder.writeln("Text 2");

builder.writeln("Text 3");

builder.writeln("Text 4");

int i = 1;

PdfSaveOptions options = new PdfSaveOptions();

for (Paragraph para : (Iterable<Paragraph>)doc.getChildNodes(NodeType.PARAGRAPH, true))

{

//Add bookmarks for custom styles

if (para.getParagraphFormat().getStyle().getName().equals("CustomStyle"))

{

builder.moveTo(para);

builder.startBookmark("BM_" + i);

builder.endBookmark("BM_" + i);

options.getOutlineOptions().getBookmarksOutlineLevels().add("BM_" + i, i);

i++;

}

}

options.getOutlineOptions().setExpandedOutlineLevels(3);

doc.save(MyDir + "Out.pdf", options);


Hi Tahir,

Thanks a ton for support.

Now, I am want that track changes of word also gets reflected in PDF file. You told me that it in not possible now with Aspose. You also told me that an issue WORDSNET-2120 is logged for this feature.

So, could you please let me know, till when can I expect the that issue WORDSNET-2120 would resolved and track changes feature would be available for use?


Chandan

Hi Chandan,

Thanks for your patience. We have a good news for you that is WORDSNET-2120 has now been resolved and this feature will be included in the next version of Aspose.Words (v13.4.0) which is planned to be released by the end of April. We will inform you via this forum thread as soon as April release is published.



Will this feature would also be available for Java API?

Hi Chandan,

Thanks for your inquiry. Yes, this feature will also be included in Aspose.Words for Java.

The issues you have found earlier (filed as WORDSNET-2120) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi Tahir/Aspose Team,

Its really good to know that Word track changes is now supported by the latest version of Aspose.Word.

However, I downloaded the latest API and try to see if it fits with my criteria but I went in to the problems. The trial version only converts only few pages of the Word to PDF. In my case, word documents (that I want to convert) contains more than 200 pages. And I want to see whether whole document gets converted into PDF and EXACTLY with same number of pages as in word doc.

This is because one of our client reported this issue with the existing solution therefore we are now looking out for a better solution and Aspose.Word seems to be a feasible solution as it supports “Track Changes” also.

Please (if possible) provide me license(a trial version) that converts full word document to PDF.

Thanks,
Chandan

Hi Chandan,

Thanks for your inquiry. Please note that in evaluation mode there are some limitations applied. E.g Aspose.Words injects an evaluation watermark at the top of the document. The document's content are truncated after a certain number of paragraphs during import or export.

To avoid this you can request a free 30-day trial license which removes these evaluation restrictions. You can request this from here:
http://www.aspose.com/corporate/purchase/temporary-license.aspx