15,900,906 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 11834242 (Top 5 by date)
Member 11834242
25-Jul-15 5:16am
View
can u suggest me the changes i need to make in my code.
in my code i have specified the locatio by "new Program().generateImages("E:\\pro2\\Document.docx");"
but while making an application, i am not allowed to define the path earlier , so what changes are required?
Member 11834242
15-Jul-15 5:21am
View
if i have to make application or button where user would upload the path or file, how to put up this in my code
Member 11834242
15-Jul-15 5:20am
View
here is my code to convert .docx to .jpg
import com.aspose.words.Document;
import com.aspose.words.ImageSaveOptions;
import com.aspose.words.SaveFormat;
/**
* Created by me
*/
public class Program {
public static void main(String args[]) throws Exception {
new Program().generateImages("E:\\pro2\\Document.docx");
}
public void generateImages(final String sourcePath) {
try {
Document doc = new Document(sourcePath);
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.JPEG);
options.setJpegQuality(100);
options.setResolution(100);
for (int i = 0; i < doc.getPageCount(); i++) {
String imageFilePath = sourcePath + "_output_" + i + ".jpg";
options.setPageIndex(i);
doc.save(imageFilePath, options);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
the only problem is i wish to make an application and take the file as an input from user instead of specifying the whole path and file name as i did on my code
Member 11834242
13-Jul-15 13:42pm
View
i am stucked at first part that is document to .jpeg conversion using java
Member 11834242
13-Jul-15 13:39pm
View
i am having trouble in using aspose.words for it