PDFium for Web Assembly is working and has a web demo

1.694 visninger
Gå til det første ulæste opslag

Paulo Coutinho

ulæst,
31. jan. 2021, 05.07.2031.01.2021
til pdfium
Hi,

It is working on my project here:

And you can test on web here:

Consider donation on Sponsor button.

Problems:

  1. Some images are blue and i don't know why. Anyone understand why and can help?
    download (1).png


Thanks.

Paulo Coutinho

ulæst,
31. jan. 2021, 06.45.2131.01.2021
til pdfium
Hi,

I have fixed the color problem.

Daniel Hosseinian

ulæst,
1. feb. 2021, 15.32.5101.02.2021
til Paulo Coutinho, pdfium
Hi Paulo,

Neat project!

Glad to see you figured out the color problem. Were the images coming out blue because of the byte order? FPDF_REVERSE_BYTE_ORDER is helpful for switching from BGRA to RGBA when rendering to bitmaps.

Best,
Daniel

--
You received this message because you are subscribed to the Google Groups "pdfium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/5d3530b8-3e7b-40c9-9523-d4df610bf4fbn%40googlegroups.com.


--
Google Logo
Daniel Hosseinian
Software Engineer
dh...@google.com
+1 424-341-4575

Paulo Coutinho

ulæst,
1. feb. 2021, 15.44.0601.02.2021
til Daniel Hosseinian, pdfium
Wow nice man! Much more fast than my loop to change the bytes.

I see these options but don't see this exact option to revert it.

Thanks man.

--
Atenciosamente, 
Paulo Coutinho.
PRS - Soluções Inteligentes
Blog: www.pcoutinho.com 
Skype: paulo.prsolucoes

Daniel Hosseinian

ulæst,
1. feb. 2021, 15.50.5501.02.2021
til Paulo Coutinho, pdfium
I'm not sure if I understood your concern exactly :) 

You can use that flag in the `flag` parameter of methods like `FPDF_RenderPageBitmap()`. Here's an example where Chromium calls PDFium [1].

Paulo Coutinho

ulæst,
1. feb. 2021, 16.15.5801.02.2021
til Daniel Hosseinian, pdfium
Yes, I understand and i'm using it now.

I sad that I see this options/flags in the past but i don't remember about this option to revert bytes.

Im making now a better PDF modal in javascript to show the images without stretch the images.

Thanks.



Paulo Coutinho

ulæst,
1. feb. 2021, 20.06.1401.02.2021
til Daniel Hosseinian, pdfium
Hey man,

I have added a lot of functions now:


or direct with PDF:


Im making a public viewer for any PDF.

Can you test?

I have tested with big/small PDF, with and without complex images, but only one PDF don't render images in my test. I will attach here. Can you help me understand why these images not render, but only the test?

Thanks.

sample-pdf-with-images.pdf

Daniel Hosseinian

ulæst,
1. feb. 2021, 20.28.3801.02.2021
til Paulo Coutinho, pdfium
Hi Paulo,

Again -- neat website! I'm glad to see developers put PDFium to great use!

Regarding your problem -- I'm not sure why the images are missing but I recommend that you try rendering the document with `pdfium_test` [1]. If it does render (which I think it should), then compare that code to yours. I took a quick look at your code [2] and I didn't see anything wrong with it. But then again, I didn't have time for a deep debug.

Please let me know if I can forward you to any other resources.

Cheers,
Danie;

Paulo Coutinho

ulæst,
1. feb. 2021, 23.33.0601.02.2021
til Daniel Hosseinian, pdfium
Hi,

The source code is here:

I have compared to your file (pdfium_test) and changed to version 3 only, but make no difference.

I see the render function too and don't see differences, only that you can enable v8, but i don't know if it is the problem.

I will test pdfium_test after.

Thanks anyway.


Daniel Hosseinian

ulæst,
2. feb. 2021, 12.18.0502.02.2021
til Paulo Coutinho, pdfium
Yup, give pdfium_test a try. By the way, pdfium_test has runtime flags for disabling V8, although I doubt that this PDF embeds any JavaScript.

Paulo Coutinho

ulæst,
5. feb. 2021, 14.18.5705.02.2021
til pdfium
Hi,

After test with pdfium_test program, i have some conclusions:

- the page was exported with success (image is attached) with command:

./pdfium_test --png --pages=0 ~/Documents/PDF/sample-pdf-with-images.pdf

- there is no problem in render process of pdfium for desktop (ex: macos)

- something or is not compiled for wasm or some code are necessary to render it like in desktop program


I only need understand what is wrong now to finish it.


sample-pdf-with-images.pdf.0.png
sample-pdf-with-images.pdf

Paulo Coutinho

ulæst,
26. mar. 2021, 01.57.4426.03.2021
til pdfium
Hi,

Can anyone help me on this?

Thanks.

Paulo Coutinho

ulæst,
14. maj 2021, 15.27.1014.05.2021
til pdfium
Hi,

We discovered some tips about the problem:

[attached]

It is related to "Jpeg Decoding".

Thanks for any help.

118282704-dda87700-b4ce-11eb-961a-df184c968787.png

Paulo Coutinho

ulæst,
15. maj 2021, 14.42.1615.05.2021
til pdfium
Hi,

Finally make it work.

The full issue history is here:

The repository updated is here:

And the web demo is here:

Thanks.
Svar alle
Svar til forfatter
Videresend
0 nye opslag