Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 50 additions & 3 deletions src/v2/pdf_resources/page_dimension.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ namespace pdflib
void pdf_resource<PAGE_DIMENSION>::execute(nlohmann::json& json_resources,
QPDFObjectHandle qpdf_resources)
{
LOG_S(INFO) << __FUNCTION__;
LOG_S(INFO) << __FUNCTION__ << ": " << json_resources.dump(2);

if(json_resources.count("/Rotate"))
{
Expand Down Expand Up @@ -337,15 +337,62 @@ namespace pdflib
}

if((not initialised) and json_resources.count("/CropBox"))
{
{
std::stringstream ss;
ss << "defaulting to crop-box";
LOG_S(INFO) << ss.str();

bbox = crop_bbox;
initialised = true;
}
else if(not initialised)
//else if(not initialised)
else if((not initialised) and json_resources.count("/MediaBox"))
{
std::stringstream ss;
ss << "defaulting to media-box";
LOG_S(INFO) << ss.str();

crop_bbox = media_bbox;

bbox = media_bbox;
initialised = true;
}
else if((not initialised) and json_resources.count("/ArtBox"))
{
std::stringstream ss;
ss << "defaulting to art-box";
LOG_S(INFO) << ss.str();

crop_bbox = art_bbox;
media_bbox = art_bbox;

bbox = art_bbox;
initialised = true;
}
else if((not initialised) and json_resources.count("/BleedBox"))
{
std::stringstream ss;
ss << "defaulting to bleed-box";
LOG_S(INFO) << ss.str();

crop_bbox = bleed_bbox;
media_bbox = bleed_bbox;

bbox = bleed_bbox;
initialised = true;
}
else if((not initialised) and json_resources.count("/TrimBox"))
{
std::stringstream ss;
ss << "defaulting to trim-box";
LOG_S(INFO) << ss.str();

crop_bbox = trim_bbox;
media_bbox = trim_bbox;

bbox = trim_bbox;
initialised = true;
}
else
{
std::stringstream ss;
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading