Comments (7)
Well I agree with the previous comment. Be cautious about cc'ing people.
The work is done by a filter.
Take a look here
from jodconverter.
cc'ing 6 people in an opening of an OSS-repo issue is what gets you on my ignore list. Sorry.
from jodconverter.
can you please tell me how to run JodConvertor? I'm getting the following error:
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.
SLF4J: Ignoring binding found at [jar:file:/home/itcloud/.m2/repository/ch/qos/logback/logback-classic/1.2.11/logback-classic-1.2.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See https://www.slf4j.org/codes.html#ignoredBindings for an explanation.
Exception in thread "main" java.lang.IllegalStateException: This office manager is not running.
at org.jodconverter.core.office.AbstractOfficeManagerPool.execute(AbstractOfficeManagerPool.java:206)
at org.jodconverter.local.LocalConverter$LocalConversionJob.doExecute(LocalConverter.java:181)
at org.jodconverter.core.job.AbstractConversionJob.execute(AbstractConversionJob.java:63)
at org.example.PageFilterMultiPage.main(PageFilterMultiPage.java:33)
Disconnected from the target VM, address: '127.0.0.1:41585', transport: 'socket'
update:- ran successfully using the following:-
LocalOfficeManager officeManager = LocalOfficeManager.install();
officeManager.start();
&&
ByteArrayOutputStream baos = new ByteArrayOutputStream()
LocalConverter.builder().officeManager(officeManager).filterChain(new PagesSelectorFilter(i)).build().convert(new FileInputStream(input)).as(Objects.requireNonNull(DefaultDocumentFormatRegistry.getFormatByExtension("txt"))).to(baos).as(targetFormat) .execute();
@sbraconnier do you suggest creating a PR with the documentation update?
from jodconverter.
Ref: #352 (comment)
@sbraconnier can you please link me to one single call to LibreOffice API or OpenOffice API in the flow, where multi-page is getting converted to PNG
Thank you so much for your time!
from jodconverter.
I'm not sure I understand the question... There isn't a "one single call". The concept of JODConverter is doing programmatically what could be done manually. So, the manual steps for what you are trying to do are:
- You open the source document (docx,ppt, xls, whatever). This is done here
- You "edit" the source document by deleting everything you don't want to be exported as PNG (this is what the PageSelectorFilter does.
- You export your edited document as PNG. This is done here
from jodconverter.
Currently, Jodconverter is writing the buffer stream
(Java Stream
) to PNG. It uses the filter writer_png_Export
for text files. It breaks the input into a buffer stream, takes bytes from them, converts them into the desired output, and writes into the buffer stream.
This buffer stream having extraction of text from say 2 pages, is then passed to LibreOffice API[*] to write that extracted text to PNG format.
Attached[1] is a screen recording of debugging points.
You export your edited document as PNG. This is done here
In the method storeDocument
conversion of bufferstream
text/byte to a PNG is done.
https://github.com/jodconverter/jodconverter/blob/master/jodconverter-local/src/main/java/org/jodconverter/local/task/LocalConversionTask.java#L183-L216
While debugging, I'm unable to find the call made to convert the extracted text and store that into TargetFile
which is a PNG
.
@sbraconnier: Can you link me to the final or any call or "the call" made to "The LibreOffice API" to convert/store/write this text of the multipage text file to PNG? This would ensure that the understanding of the flow of the Jodconverter and its architecture is correct.
The issue is I'm unable to find "The LibreOffice API endpoint" call which is by converting the extracted text of a multipage text file to PNG. Converting here means, writing/storing.
I would be happy to write a PR for the architecture or describe this feature in Jodconverter so that folks don't have to debug these many internal calls to find out the LibreOffice API call.
[1] https://youtu.be/uLJd83JS35g
[*] https://listarchives.libreoffice.org/global/users/2023/msg00679.html
[**] https://bugs.documentfoundation.org/show_bug.cgi?id=157425
from jodconverter.
There isn't a single API endpoint call that does all the work.
I suggest you read this excellent website (chapter 1 in particular) that explain the technology used by jodconverter. It is not an easy API to use (not well documented and rather very complex IMO).
You may also find what you are looking for somewhere in the official OO wiki for developers:
https://wiki.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide
from jodconverter.
Related Issues (20)
- An error is reported after the office manager Temporary folder is deleted HOT 1
- Converting spreadsheetML (XML Spreadsheet 2003) to XLSX (Excel Workbook) results in timeout HOT 5
- Cannot find a valid unoloader.jar path. HOT 2
- While Excel to pdf convertion reference cell values not reflected in other sheet excel . HOT 1
- use jodconverter remote cant start project HOT 4
- How do I convert a particular page of ppt/excel/text file to PNG using Java Uno API's HOT 1
- Error: This office manager is not running. HOT 2
- there are a blank column in my pdf HOT 1
- 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
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.