Commit 869d69c0 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Printing: fix margins when printing to PostScript printers

Since we now send a PDF from print preview, the offsets aren't computed
in PrintRenderFrameHelper. They should be the printable area offsets,
not the content area. The content area offsets reflect the margins set
in Print Preview, which are no longer relevant since the generated PDF
already includes these margins.

Bug: 821485
Change-Id: I5ba009408bb7bb0251cdd85b3ed7b6e10e293826
Reviewed-on: https://chromium-review.googlesource.com/962878
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543192}
parent dcb86ba6
......@@ -267,11 +267,9 @@ void PrintViewManagerBase::StartLocalPrintJob(
gfx::Size page_size = settings.page_setup_device_units().physical_size();
gfx::Rect content_area =
gfx::Rect(0, 0, page_size.width(), page_size.height());
gfx::Point offsets =
gfx::Point(settings.page_setup_device_units().content_area().x(),
settings.page_setup_device_units().content_area().y());
PrintDocument(document, print_data, page_size, content_area, offsets);
PrintDocument(document, print_data, page_size, content_area,
settings.page_setup_device_units().printable_area().origin());
std::move(callback).Run(base::Value());
}
#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment