Canciller / react-native-images-to-pdf

Easily generate PDF files from images in React Native.
MIT License
27 stars 11 forks source link

PDF Quality/Size as prop #21

Open mwerder opened 10 months ago

mwerder commented 10 months ago

Is your feature request related to a problem? Please describe.

Hey there, first of all I really appreciate your library. I used that one so far, which is not maintained anymore, that's why I am switching to yours. The other ilb had the possibility to add the quality for the pdf to reduce its size. As we store our Docs to the cloud, it's crucial that the PDFs are smaller.

Describe the solution you'd like

Thats how the other library handled it:

        const options = {
            imagePaths: imagePaths: ['/path/to/image1.png','/path/to/image2.png'],
            name: name: 'PDFName',
            maxSize: { // optional maximum image dimension - larger images will be resized
                width: 900,
                height: Math.round(deviceHeight() / deviceWidth() * 900),
            },
            quality: .7, // optional compression paramter
        };
        const pdf = await RNImageToPdf.createPDFbyImages(options);

Describe alternatives you've considered

Additional context

Have you considered adding something like that? I could contribute if you're interested.

Cheers

RudraSen2 commented 3 months ago

As a workaround maybe you could reduce the size of the images, instead of the pdf