mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
LibPDF/PDFViewer: Support rotated pages
This commit is contained in:
parent
fbe712e265
commit
d5f94aaa7b
3 changed files with 22 additions and 3 deletions
|
@ -88,7 +88,13 @@ Page Document::get_page(u32 index)
|
|||
if (raw_page_object->contains("UserUnit"))
|
||||
user_unit = raw_page_object->get_value("UserUnit").to_float();
|
||||
|
||||
Page page { move(resources), move(contents), media_box, crop_box, user_unit };
|
||||
int rotate = 0;
|
||||
if (raw_page_object->contains("Rotate")) {
|
||||
rotate = raw_page_object->get_value("Rotate").as_int();
|
||||
VERIFY(rotate % 90 == 0);
|
||||
}
|
||||
|
||||
Page page { move(resources), move(contents), media_box, crop_box, user_unit, rotate };
|
||||
m_pages.set(index, page);
|
||||
return page;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue