Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

How to set PDF height dynamically using 'react-native-html-to-pdf' package?

$
0
0

I am creating a PDF document in react-native. My aim is to create single page,no more pages and while my page's content gets bigger, my single page's height also must get bigger automatically.

options = {            width: 675,            height: ????,            html: `<div id="myDiv" style="width: 100%; min-height: 850px"> </div>`            }

In the above code, I set myDiv's min-height and when myDiv's height changes dynamically, I want to take this height value and set the option's height automatically. I tried javascript offsetHeight property but it does not work because HTML's inside is completely a string. I tried to use template literals, but i couldn't succeed.

Is there a way to handle this,using template literals or any other ways?


Viewing all articles
Browse latest Browse all 16552

Trending Articles