Save Format.pdf Problem

Hafsa101: Hey is there any thing done yet for issue of issue of pdf document size changing

Hi Hafsa,

As we recently have been able to notice this issue, and until or unless we have investigated and have figured out the actual reasons of this problem, we might not be able to share any timelines by which this problem will be resolved.

However, as soon as we have made some significant progress towards the resolution of this issue, we would be more than happy to update you with the status of correction. Please be patient and spare us a little time. Your patience and comprehension are greatly appreciated in this regard.

Alright Thank you for the consideration

hey i have been waiting for a lot of time for the right code of page splitter
Please give me the latest code. Thank you.
Waiting

Hi Hafsa,


Thanks for your patience.

The issue is still pending for investigation and is not yet resolved. However as soon as we have made some progress towards its resolution, we will update you within this forum thread.

Hi Hafsa,


Thanks for your inquiry.
Hafsa:
hey i have been waiting for a lot of time for the right code of page splitter
Please give me the latest code. Thank you.
Waiting
The latest code is attached with this post. Please let us know if you have any troubles and we will be glad to look into this further for you.

Best regards,

I have tried… This code is not working and the related issue is detailed in the respective post…

Hi Hafsa,


Unfortunately, your question isn’t clear enough therefore we request you to please elaborate your inquiry further by providing sample document and summarize your scenario in next post. Once you provide complete details, we will be in a better position to address your concerns accordingly. Thanks for your cooperation.

Best regards,

hey
i wanted to elaborate that i have used your attached solution… it requires me to change all the foreach loops as they are not supported due to java.lang.variable error .
after changing the foreach loops, i get the error
Hi there thankyou for the concern,
i checked your code and its giving these error
at Test.PageSplitter.visitParagraphEnd(PageSplitter.java:125)
at com.aspose.words.Paragraph.zzY(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.Paragraph.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.Body.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.Section.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.Document.accept(Unknown Source)
at Test.PageFinder.splitNodesAcrossPages(PageFinder.java:165)
at Test.Test1.main(Test1.java:154)
by executing the code.

I am not able to run this code as it cannot be compiled due to an error


com.aspose.words.Document doc = new com.aspose.words.Document(“C:/Users/himran/Documents/Complex.docx”);

com.aspose.words.Document finalDoc = (com.aspose.words.Document)doc.deepClone(true);
finalDoc.removeAllChildren();

PageFinder finder = new PageFinder(doc);
finder.splitNodesAcrossPages(true);
ArrayList pageSections = finder.retrieveAllNodesOnPages(2, 2, NodeType.SECTION);

for (Section section : (Iterable) pageSections)
finalDoc.appendChild(finalDoc.importNode(section, true));

finalDoc.save(“C:/Users/himran/Documents/out.doc”);


The error is on line
finalDoc.appendChild(finalDoc.importNode(section, true));
and the error is :
The method importNode(Node, boolean) in the type DocumentBase is not applicable for the arguments (Section, boolean)

Hi Hafsa,


Thanks for the additional information. The classes found in “Page-Splitter-and-Finder.zip” should work with Java 7 or higher. So, please upgrade to latest Java JDK. Secondly, could you please attach your input document “Complex.docx” here for testing? We will investigate the issue on our end and provide you more information. Also, are you getting this problem with one particular document or every document you try to paginate cause the same exception?

Best regards,

Hi Hafsa,


Thanks for your inquiry. After an initial test with Aspose.Words for Java 14.12.0, I was unable to reproduce this issue on my side. I would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link. I hope, this helps.
http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/default.aspx

In case the problem still remains, please attach your modified code (where you changed for loops) here for testing.

Best regards,