This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Need Suggestions-editting word documents.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been creating a "tool" which basically takes two documents, and merges them together while removing some irrelevant pages from the documents. The irrelevant pages are determined based on user input. I have created a working version using itext and pdfbox. The problem is that the document needs to be edited even after it is run through the program. Therefore the ideal final file type would be a word document (.doc or .docx). So now I need to change it to export into a .doc format. I have both original documents in word and pdf versions. I am trying to avoid using pdf at all. I have tried doing this with apache poi and open office API, and not that they don't work, I am just not able to figure out how to merge the documents and to remove pages.

I am looking for any help/suggestions on what I should do.

Anything would be greatly appreciated.

Thank you.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to more appropriate forum.

(Nothing involving a Word document is "ideal.")

What specific issue(s) are you having?
 
Ryan Offir
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

David Newton wrote:
(Nothing involving a Word document is "ideal.")

What specific issue(s) are you having?



It isn't so much issues, as it is that I do not know where to start. I tried using Apache POI, and I could even upload the existing documents, let alone remove pages from them. The big thing is that when the final file gets exported it will still need to be edited afterwords outside of the program. I have done this program using just pdf's and it works, but, as I said and obviously, a pdf is not very editable. So my "ideal" file type would be to do everything in .doc format.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Upload" in what sense? To the server? Or import into POI?

I mean, the getting started/tutorial docs go through that, so without specific information, it's impossible to help.
 
Ryan Offir
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

David Newton wrote:"Upload" in what sense? To the server? Or import into POI?

I mean, the getting started/tutorial docs go through that, so without specific information, it's impossible to help.



Some Background:

There are two documents (both have .doc and .pdf version), I have created a GUI in which a user provides some input. Based on that input some pages from the 1st doc will be removed. Next, step is that the user picks a save location on their computer, and then the 1st document (with the pages taken out) will be added to the second document (merged together) and saved on their computer. This final document will need to be edited, so I am trying to make this work with using docs and not pdfs.

I have tried some of the tutorials but I got no where, if you know of any that I may have missed I would love to try them.

 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Getting nowhere" still doesn't help--we still don't know what you can't do. We can't see your attempts. We don't know what you've tried. We don't know what issues you've had.
 
Ryan Offir
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

David Newton wrote:"Getting nowhere" still doesn't help--we still don't know what you can't do. We can't see your attempts. We don't know what you've tried. We don't know what issues you've had.



The point is I haven't really gotten anywhere at all.
I have created an HWPF Document form an input stream. That's about it. I have tried using the range class but haven't been able to "find" the pages I want to delete. After this point I thought maybe I should look into OpenOffice, but I can't find many examples/documentation and I wasn't even able to create a file to do anything with.
I'm sorry for my inexperience but I have never done anything in java with Microsoft documents before.
 
please buy this thing and then I get a fat cut of the action:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!