Code Monkey home page Code Monkey logo

Comments (7)

sbraconnier avatar sbraconnier commented on May 23, 2024 1

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.

EugenMayer avatar EugenMayer commented on May 23, 2024

cc'ing 6 people in an opening of an OSS-repo issue is what gets you on my ignore list. Sorry.

from jodconverter.

Madhupatel08 avatar Madhupatel08 commented on May 23, 2024

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'

cc: @EugenMayer @sbraconnier

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.

Madhupatel08 avatar Madhupatel08 commented on May 23, 2024

Ref: #352 (comment)

The work is done by a filter
Take a look here

@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.

sbraconnier avatar sbraconnier commented on May 23, 2024

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.

Madhupatel08 avatar Madhupatel08 commented on May 23, 2024

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.

sbraconnier avatar sbraconnier commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.