Dansoftowner / PDFViewerFX

A pdf viewer library for your javaFX application
Apache License 2.0
66 stars 24 forks source link

Performance issue #3

Closed carlogaratti closed 3 years ago

carlogaratti commented 3 years ago

Hi!

i have a file of 1.5M (pdf)

The application stars correctly but infortunatly thake a lot to open the pdf file. Capture

Do you have any suggestion?

Thanks

Simple code OutputStream stream = _202_readAFile_intoAStream_Gdrive.run("1i19zA7oxvrOdKh7SVneeRuHpaOJ1DqvP"); ByteArrayInputStream inStream = new ByteArrayInputStream(((ByteArrayOutputStream ) stream).toByteArray() ); System.out.println("aaaaa"); PDFDisplayer displayer = new PDFDisplayer(inStream); stage.setScene(new Scene(displayer.toNode())); stage.show();

Dansoftowner commented 3 years ago

Hi!

My instant suggestion would be wrapping your InputStream into a BufferedInputStream, but in this case it may not help.

But, I'm thankful for your comment because when I made this library I was in rush, and I didn't think of some real-time features like performance-optimalization. I've just made this project for showing that it is possible to wrap PDF.js in javaFX.

In the near future I will make this project more advanced and more up-to-date. I will keep in mind your issue when I develop this project further.

Best regards!

carlogaratti commented 3 years ago

Thanks!

Dansoftowner commented 3 years ago

Hi!

I made a performance improvement in v0.7, hopefully that solves the problem.