brentnycum/BNHtmlPdfKit

When using <html dir="rtl"> PDF ends up with unnecessary page breaks.

Closed this issue · 1 comments

Finally narrowed down this bug.
Tried to create a PDF out of a right-to-left web page (in Hebrew).
You can see the weird page breaks in the attached screenshot.
Is it possibly an Apple bug?
I was using this method:
+ (BNHtmlPdfKit *)saveUrlAsPdf:(NSURL *)url success:(void (^)(NSData *pdfData))completion failure:(void (^)(NSError *error))failure;

The markdown goes like this:

<html dir="rtl">
    <body>
        <p>I will not skateboard in the halls</p>
        ...
    </body>
</html>

untitled

Have you tried including this CSS property on the elements that hold the text?

page-break-inside: avoid;