Vinicius Seganfredo
Vinicius Seganfredo

Reputation: 1764

How do I set XAML FlowDocument MaxPageWidth in millimeters?

I'm trying to do an Document file in XAML and I need to set the Width and Height with equivalent values to an A4 sheet(Width: 210mm. Heigth: 297mm).

Anyone knows how to do that?

Upvotes: 0

Views: 217

Answers (1)

ZekeMarsh
ZekeMarsh

Reputation: 122

After short Googling, I found this:

MSDN link

You can use the second version:

<object PageWidth="qualifiedDouble"/>

qualifiedDouble

A double value as described above, followed by one of the following unit specifiers: px, in, cm, pt.
  • px (default) is device-independent units (1/96th inch per unit)
  • in is inches; 1in==96px
  • cm is centimeters; 1cm==(96/2.54) px
  • pt is points; 1pt==(96/72) px

It's the same with PageHeight, so overall I think using it this way could solve your problem:

<FlowDocument PageWidth="21cm" PageHeight="29.7cm" />

Upvotes: 1

Related Questions