Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1667)

Side by Side Diff: pdf/pdf.h

Issue 2970473002: Add generic text printing (Closed)
Patch Set: Change enum names Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/utility/printing_handler.cc ('k') | pdf/pdf.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PDF_PDF_H_ 5 #ifndef PDF_PDF_H_
6 #define PDF_PDF_H_ 6 #define PDF_PDF_H_
7 7
8 #include "ppapi/c/ppb.h" 8 #include "ppapi/c/ppb.h"
9 #include "ppapi/cpp/module.h" 9 #include "ppapi/cpp/module.h"
10 10
(...skipping 18 matching lines...) Expand all
29 bool Init() override; 29 bool Init() override;
30 pp::Instance* CreateInstance(PP_Instance instance) override; 30 pp::Instance* CreateInstance(PP_Instance instance) override;
31 }; 31 };
32 32
33 int PPP_InitializeModule(PP_Module module_id, 33 int PPP_InitializeModule(PP_Module module_id,
34 PPB_GetInterface get_browser_interface); 34 PPB_GetInterface get_browser_interface);
35 void PPP_ShutdownModule(); 35 void PPP_ShutdownModule();
36 const void* PPP_GetInterface(const char* interface_name); 36 const void* PPP_GetInterface(const char* interface_name);
37 37
38 #if defined(OS_WIN) 38 #if defined(OS_WIN)
39 // Printing modes - type to convert PDF to for printing
40 enum PrintingMode {
41 kEmf = 0,
42 kTextOnly = 1,
43 kPostScript2 = 2,
44 kPostScript3 = 3,
45 };
46
39 // |pdf_buffer| is the buffer that contains the entire PDF document to be 47 // |pdf_buffer| is the buffer that contains the entire PDF document to be
40 // rendered. 48 // rendered.
41 // |buffer_size| is the size of |pdf_buffer| in bytes. 49 // |buffer_size| is the size of |pdf_buffer| in bytes.
42 // |page_number| is the 0-based index of the page to be rendered. 50 // |page_number| is the 0-based index of the page to be rendered.
43 // |dc| is the device context to render into. 51 // |dc| is the device context to render into.
44 // |dpi| and |dpi_y| is the resolution. If the value is -1, the dpi from the DC 52 // |dpi| and |dpi_y| is the resolution. If the value is -1, the dpi from the DC
45 // will be used. 53 // will be used.
46 // |bounds_origin_x|, |bounds_origin_y|, |bounds_width| and |bounds_height| 54 // |bounds_origin_x|, |bounds_origin_y|, |bounds_width| and |bounds_height|
47 // specify a bounds rectangle within the DC in which to render the PDF 55 // specify a bounds rectangle within the DC in which to render the PDF
48 // page. 56 // page.
(...skipping 27 matching lines...) Expand all
76 bool stretch_to_bounds, 84 bool stretch_to_bounds,
77 bool keep_aspect_ratio, 85 bool keep_aspect_ratio,
78 bool center_in_bounds, 86 bool center_in_bounds,
79 bool autorotate); 87 bool autorotate);
80 88
81 void SetPDFEnsureTypefaceCharactersAccessible( 89 void SetPDFEnsureTypefaceCharactersAccessible(
82 PDFEnsureTypefaceCharactersAccessible func); 90 PDFEnsureTypefaceCharactersAccessible func);
83 91
84 void SetPDFUseGDIPrinting(bool enable); 92 void SetPDFUseGDIPrinting(bool enable);
85 93
86 void SetPDFPostscriptPrintingLevel(int postscript_level); 94 void SetPDFUsePrintMode(int mode);
87 #endif // defined(OS_WIN) 95 #endif // defined(OS_WIN)
88 96
89 // |page_count| and |max_page_width| are optional and can be NULL. 97 // |page_count| and |max_page_width| are optional and can be NULL.
90 // Returns false if the document is not valid. 98 // Returns false if the document is not valid.
91 bool GetPDFDocInfo(const void* pdf_buffer, 99 bool GetPDFDocInfo(const void* pdf_buffer,
92 int buffer_size, 100 int buffer_size,
93 int* page_count, 101 int* page_count,
94 double* max_page_width); 102 double* max_page_width);
95 103
96 // Gets the dimensions of a specific page in a document. 104 // Gets the dimensions of a specific page in a document.
(...skipping 28 matching lines...) Expand all
125 int page_number, 133 int page_number,
126 void* bitmap_buffer, 134 void* bitmap_buffer,
127 int bitmap_width, 135 int bitmap_width,
128 int bitmap_height, 136 int bitmap_height,
129 int dpi, 137 int dpi,
130 bool autorotate); 138 bool autorotate);
131 139
132 } // namespace chrome_pdf 140 } // namespace chrome_pdf
133 141
134 #endif // PDF_PDF_H_ 142 #endif // PDF_PDF_H_
OLDNEW
« no previous file with comments | « chrome/utility/printing_handler.cc ('k') | pdf/pdf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698