Comments (6)
@evserykh Sure I am. I'm about to release the next version of JODConverter. It should be out within a week.
Not sure I understand your question. But everything you can do using OO only (without JODConverter) is doable with JODConverter. We just have to figure out how to do it programmatically.
What are you tryinh to do exactly ? (what is you input and output format?).
from jodconverter.
Sounds great, it would be amazing 👍
Let me explain what I mean. For example I have a csv file in cp1251 encoding and I want to convert it to a xls file. Using OO I have to open the csv file and select file's encoding to have it properly showed. Do you know is it possible to set input file's encoding for converting requests to jodconverter?
from jodconverter.
OK got it.
First, take a look at this wiki page to understand what I'm about to explain.
The default filter options applied when a csv file is imported is 44,34,0
, which means comma as field separator, " as text delimiter and system encoding as file encoding.
What you want, according to this table, is 44,34,34
.
You can change these default options by forcing a custom format as source format:
Using the latest master:
File inputFile = new File("document.csv");
File outputFile = new File("document.xls");
DocumentFormat csv = DocumentFormat.copy(DefaultDocumentFormatRegistry.CSV);
csv.getLoadProperties().put("FilterOptions", "44,34,34");
JodConverter.convert(inputFile).as(csv).to(outputFile).execute();
Using the 4.0.0 version:
OfficeDocumentConverter converter = ...
File inputFile = new File("document.csv");
File outputFile = new File("document.xls");
final DocumentFormatRegistry registry = DefaultDocumentFormatRegistry.create();
DocumentFormat inputFormat = registry.getFormatByExtension("csv");
DocumentFormat outputFormat = registry.getFormatByExtension("xls");
inputFormat.getLoadProperties().put("FilterOptions", "44,34,34");
converter.convert(inputFile, outputFile, inputFormat, outputFormat);
Note that I didn't test this but it should work as expected...
from jodconverter.
@sbraconnier thanks a lot. I got what you meant, but I use jodconverter web app. I asked whether can I modify my requests to jodconverter web app to set input file's encoding.
from jodconverter.
Hmm...
Do you mean you use the jodconverter-sample-webapp sample ?
If yes, my answer remains the same. The sample webapp is... well, just a sample. It is not too hard to send request parameters through a web request. You could add a drop down list of available encoding and send the selected option to the server using a request parameter (see query string). Server side, you would retrieve the request parameter using ServletRequest#getParameter and then use the retrieved encoding as shown in my previous answer.
from jodconverter.
@sbraconnier I got it. Thanks a lot for help
from jodconverter.
Related Issues (20)
- Concurrency convertion not happen HOT 4
- When converting DOCX to PDF the style is confused and many pages are lost HOT 4
- how to use it in android application ? HOT 1
- pptx file conversion of PDF failed HOT 1
- Why Task was cancelled automatically HOT 2
- StoreProperties property settings HOT 1
- Temp folder not deleted after Timeout Exceptions HOT 5
- High memory consumptiom while converting even 2-3MB of excel files to PDF HOT 5
- The Word document with more than 12 pages will automatically cancel the task. HOT 4
- Started process; pid = -2
- Error when converting Excel to PDF HOT 3
- The program running on Docker keeps generating zombie processes.
- Not working with quartz? HOT 13
- I have a question about conversion options (password, page size ,etc) HOT 10
- Xslx SparkLine HOT 1
- Decimal number, from comma to dot HOT 17
- Information about supported properties and their meaning HOT 2
- LocalOfficeManager not killing existing process on the same port HOT 4
- Same issue with Temporary file name added in CSV -> PDF conversion HOT 3
- jodconverter-local 4.4.3 or later causes the service to fail to end. HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jodconverter.