0

I found an information that A4 format can be created from a rect:

let page = CGRect(x: 0, y: 0, width: 595.2, height: 841.8) // A4, 72 dpi

I need this rect to specify a page size for my UIPrintPageRenderer object.

Also in my particular case I use web view to build PDF page based on HTML code.

I found an answer how to adopt HTML page to fit A4 size:

html,body{
    height: 842px;
    width: 595px;
}

which interesting from that example that they provide just inaccuracy values comparing to Swift code for height and width.

Just need to make sure which values are correct. Or probably we need to use inches, millimetres instead.

My PDF page must have A4 format and HTML must have the same size. From the values above you can see that they are different.

Matrosov Oleksandr
  • 23,195
  • 44
  • 142
  • 269

0 Answers0