Some test text!
Reflow makes the document more flexible and easier to read, especially on small devices. PDFTron is able to extract the reflowable layout of each page in a PDF document to an HTML file. First, we explain how simple it is to show a widget that allows the user to swipe left or right through the pages of the document to see reflowable document pages. Then, we provide the methods necessary for converting a hard-layout PDF page to an HTML document page.
To set up your layout with
ReflowControl, add a
<ReflowControl> element to your XML layout. For example, if each page in the swipe view should consume the entire layout, then your layout looks like this:
<pdftron.PDF.Controls.ReflowControl android:id="@+id/reflow" android:layout_width="match_parent" android:layout_height="match_parent" />
Then, you need to attach a
PDFDoc to the reflow pager:
To refresh the reflow pager to show the latest changes on your document, you should let the reflow pager know that the document has been modified:
It is possible to change the size of reflowable text. The default text size is
100; valid values are
1600. See the following code as an example:
Alternatively, you can zoom in/out to change the reflowable text size:
Assuming the current text size is 100%, by calling zoomReflow(reflowControl, true) and zoomReflow(reflowControl, false) the new text size will be 125% and 75% of the original size, respectively.
There are three methods to change the background color:
setDayMode(): no background
setNightMode(): night background
setCustomColorMode(int): customized background
You can support right-to-left languages by setting the direction of reflowable text by calling