cesarvr / pdf-generator

Cordova plugin to generate pdf in the client-side
MIT License
106 stars 62 forks source link

Limite para geração do arquivo pdf #119

Open anapaulaweiss opened 4 years ago

anapaulaweiss commented 4 years ago

dependendo o tamanho do html ao tentar gerar para pdf o plugin aborta o aplicativo, 160kb já aborta.

cesarvr commented 4 years ago

Hi @anapaulaweiss,

For what I can understand the plugin is basically crashing for content above 160KB. Unfortunately I cannot reproduce this error. I wrote this project example that maybe can provide you with some guidance, here is quick demo:

ezgif com-video-to-gif

As you can see in those two example the plugin is able to convert HTML content of considerable size.

anapaulaweiss commented 4 years ago

qual tamanho aproximado desse html do seu exemplo?

cesarvr commented 4 years ago

default.pdf my-pdf.pdf First one is 870KB The Second one is 4.9 MB

anapaulaweiss commented 4 years ago

realmente, fiz um teste aqui, e são 160kb só do texto html, mas possui muitas imagens e acaba passando de 7MB, nesse caso qual seria a sugestão para esses arquivos com muitas imagens e que acabam ficando muito grande?

cesarvr commented 4 years ago

Sorry I don't speak Portuguese, but google translator tells me that you are asking something about: "We can assume the PDF files are that big because of the images" -- the answer will be yes, the PDF file acts as a container (or zip file) that encompass all kind of assets such as words, images, videos, etc.

Also if is crashing can you share the error message and platform you are using ? That would be helpful.

Cheers

anapaulaweiss commented 4 years ago

of course, sorry. Would you have a solution that you would recommend for this type of larger file?

anapaulaweiss commented 4 years ago

there is no error, just abort the application, I realized that for some cell phones with the same file size it did not abort the application and for another yes, it seems to be related to the memory of the cell