Page Breaks on a Form for Printing


#1

Is it possible to create a very simple form with just the following html code in NSB?

<!DOCTYPE html><html><body>
<table><tr><td>table1</td></tr></table>
<div style='page-break-after:always;'>&nbsp;</div>
<table><tr><td>table2</td></tr></table>
</body></html>

The reason concerns the “page-break-after:always” div.

How “page-break-after:always” works: when Ctrl-P (or Print) is issued from the browser the preview shows two separate printable pages instead of the one continuous web page. This works OK when the above code is executed when saved as an html file and run from the Chrome browser (that is, it is not a Web App). But when put into an NSB HTMLView control the “page-break-after” doesn’t work (I also tried a label object).

Note that W3Schools says the following: “You cannot use this property on an empty <div> or on absolutely positioned elements.” This may or may not have relevance. I have tried setting the Forms position property to all available settings without success.

Thanks, John


#2

I’d probably generate a PDF in response to the user print request. That way you have full control over margins, format etc.


#3

I tried that but

  1. when saved it is saved in the “download” directory of the device. I don’t think this can be changed in the app, but I’ll look at changing the path of this directory on the device.

  2. I would also have to add “padding” to each page appropriately and exactly to insure the pdf makes it’s page breaks at the exact right location. This can probably be done, just not tried because 1) above is a no go for my client unlless the save drive/path can be change.

Thanks, John


#4

Will this app only be on the desktop? Not on devices?


#5

That’s correct, only on Windows PC.

John


#6

Any thoughts on this yet?

Thanks, John


#7

George:

When you replied with “Will this app only be on the desktop? Not on devices?” I was hoping you had some idea on how to do the following described in my earlier post:

"Is it possible to create a very simple form with just the following html code in NSB?

<!DOCTYPE html><html><body>
<table><tr><td>table1</td></tr></table>
<div style='page-break-after:always;'>&nbsp;</div>
<table><tr><td>table2</td></tr></table>
</body></html>

… etc."

Either way could you let me know if this is possible in NSB?

Thanks, John


#8

If there’s no answer from me, it’s because I don’t know. It’s not helpful for me to give an answer like that - it could discourage others from looking at it.

This really isn’t a question about AppStudio itself. It’s how HTML works. There are many, many people who know more that HTML than I do.