| Index: printing/printed_document_mac.cc
|
| diff --git a/printing/printed_document_mac.cc b/printing/printed_document_mac.cc
|
| index 73286966f993986daba7c976d96427e62c0cb7ad..0cd00e04afb6ee8c3a66953c67aefdd0f9fd8706 100644
|
| --- a/printing/printed_document_mac.cc
|
| +++ b/printing/printed_document_mac.cc
|
| @@ -4,11 +4,12 @@
|
|
|
| #include "printing/printed_document.h"
|
|
|
| -#import <ApplicationServices/ApplicationServices.h>
|
| -#import <CoreFoundation/CoreFoundation.h>
|
| +#include <ApplicationServices/ApplicationServices.h>
|
| +#include <CoreFoundation/CoreFoundation.h>
|
|
|
| #include "base/logging.h"
|
| #include "printing/page_number.h"
|
| +#include "printing/pdf_metafile_cg_mac.h"
|
| #include "printing/printed_page.h"
|
|
|
| namespace printing {
|
| @@ -31,11 +32,16 @@ void PrintedDocument::RenderPrintedPage(
|
| page.GetCenteredPageContentRect(page_setup.physical_size(), &content_area);
|
|
|
| const MetafilePlayer* metafile = page.metafile();
|
| +
|
| // Each Metafile is a one-page PDF, and pages use 1-based indexing.
|
| const int page_number = 1;
|
| - struct Metafile::MacRenderPageParams params;
|
| + PdfMetafileCg::RenderPageParams params;
|
| params.autorotate = true;
|
| - metafile->RenderPage(page_number, context, content_area.ToCGRect(), params);
|
| + std::vector<char> buffer;
|
| + if (metafile->GetDataAsVector(&buffer)) {
|
| + PdfMetafileCg::RenderPage(buffer, page_number, context,
|
| + content_area.ToCGRect(), params);
|
| + }
|
| }
|
|
|
| } // namespace printing
|
|
|