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

Free Support Forum - aspose.com

Aspose.Words Java Reading only 6 pages of DocX

Hi,


I am using Aspose.Words java with a trial license. I am trying to process a 13 page DOCX file to extract hyperlinks from it. But the program stops at the end of page 6. No exceptions.

Is there a restriction with trial license that it would process only 6 pages? Source code below.

// Open the document.
Document doc = …;
// Hyperlinks in a Word documents are fields, select all field start nodes so we can find the hyperlinks.
NodeList fieldStarts = doc.selectNodes("//FieldStart");
String linkName; String linkURL;
for (FieldStart fieldStart : (Iterable) fieldStarts)
{
if (fieldStart.getFieldType() == FieldType.FIELD_HYPERLINK)
{
// The field is a hyperlink field, use the “facade” class to help to deal with the field.
Hyperlink hyperlink = new Hyperlink(fieldStart);
linkName = hyperlink.getName();
linkURL= hyperlink.getTarget();
// Some hyperlinks can be local (links to bookmarks inside the document), ignore these.
if (hyperlink.isLocal() || linkURL.startsWith(“mailto:”))
System.out.println(“Internal : " + linkName + " \n\t” + linkURL);
else
System.out.println(“External : " + linkName + " \n\t” + linkURL);
}
}

doc.getPageCount() - returns value 7 instead of 13


I use a temporary license requested through this URL: http://www.aspose.com/corporate/purchase/temporary-license.aspx

Hi there,


Thanks for your inquiry. We will appreciate it if you please share your sample document here. We will look into it and will guide you accordingly.

Furthermore, please note Aspose.Word without a license implementation provides full product functionality, but it inserts an evaluation watermark at the top of the document on open and save, and limits the maximum document size to several hundred paragraphs.

Best Regards,

Hi,

It is a internal policy document. So, i am unable to share it.

Is there a way to troubleshoot this?
Is there a way to output the document that is actually being processed (the document with evaluation watermark inserted)

i was able to figure this out. With the statements below, i was able to output the real (truucated) document that is being processed.


Document doc = …;
doc.save(“c:\test.docx”);

Thank you.