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

Free Support Forum - aspose.com

Words Java - Missing Class DocumentPageSplitter

I cant find the DocumentPageSplitter class in the java aspose-words library. I am using version 19.10.

I am trying to follow the example here

I get this error on build
cannot find symbol [ERROR] symbol: class DocumentPageSplitter

This is my pom.xml file

<dependency>
        <groupId>com.aspose</groupId>
        <artifactId>aspose-words</artifactId>
        <version>19.10</version>
        <classifier>jdk17</classifier>
    </dependency>
    <dependency>
        <groupId>com.aspose</groupId>
        <artifactId>aspose-words</artifactId>
        <version>19.10</version>
        <classifier>javadoc</classifier>
    </dependency>

Ignore this, I see the Class is defined in the same file and the example.

@deanvniekerk

It is nice to hear from you that your problem has been solved. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.

i am still facing this issue, unable to find the class DocumentPageSplitter in java, am using com.aspose:aspose-words:20.2:jdk17’ and com.aspose:aspose-words:20.2:javadoc

@1623751199347

We suggest you please use the Document.extractPages method as shown below instead of PageSplitter utility. This method returns the Document object representing specified range of pages.

Document doc = new Document(MyDir + "input.docx");
Document dst = doc.extractPages(0, 1);;
dst.save(MyDir + "output.pdf");

Thank you Tahir for the response… i even tried this …but it says Cannot resolve method ‘extractPages’ in ‘Document’ , we are using aspose-words:20.2:jdk16 and aspose-words:20.2:javadoc

@1623751199347

Please use the latest version of Aspose.Words for Java 21.9 to avoid the shared issue.

hey…it worked…thank you…