|
|
@ -124,8 +124,15 @@ function Document:getPageDimensions(pageno, zoom, rotation)
|
|
|
|
return native_dimen
|
|
|
|
return native_dimen
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--[[
|
|
|
|
|
|
|
|
This method returns pagesize if bbox is corrupted
|
|
|
|
|
|
|
|
--]]
|
|
|
|
function Document:getUsedBBoxDimensions(pageno, zoom, rotation)
|
|
|
|
function Document:getUsedBBoxDimensions(pageno, zoom, rotation)
|
|
|
|
ubbox = self:getUsedBBox(pageno)
|
|
|
|
ubbox = self:getUsedBBox(pageno)
|
|
|
|
|
|
|
|
if ubbox.x0 < 0 or ubbox.y0 < 0 or ubbox.x1 < 0 or ubbox.y1 < 0 then
|
|
|
|
|
|
|
|
-- if document's bbox info is corrupted, we use the page size
|
|
|
|
|
|
|
|
ubbox_dimen = self:getPageDimensions(pageno, zoom, rotation)
|
|
|
|
|
|
|
|
else
|
|
|
|
ubbox_dimen = Geom:new{
|
|
|
|
ubbox_dimen = Geom:new{
|
|
|
|
x = ubbox.x0,
|
|
|
|
x = ubbox.x0,
|
|
|
|
y = ubbox.y0,
|
|
|
|
y = ubbox.y0,
|
|
|
@ -135,6 +142,7 @@ function Document:getUsedBBoxDimensions(pageno, zoom, rotation)
|
|
|
|
if zoom ~= 1 then
|
|
|
|
if zoom ~= 1 then
|
|
|
|
ubbox_dimen:transformByScale(zoom)
|
|
|
|
ubbox_dimen:transformByScale(zoom)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
return ubbox_dimen
|
|
|
|
return ubbox_dimen
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|