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

Unified Diff: pdf/pdf_engine.h

Issue 376083002: Export a function from the PDF plugin to get the dimensions of a PDF page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typo in comments. Moved all the comments over to pdf_engine.h. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pdf/pdf.cc ('k') | pdf/pdfium/pdfium_engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdf_engine.h
diff --git a/pdf/pdf_engine.h b/pdf/pdf_engine.h
index ee1cb1ff000341f1f0569dc1d617de11ee1260f5..17c9210aab11b8e2dc20775912ab13a4dbf72a9c 100644
--- a/pdf/pdf_engine.h
+++ b/pdf/pdf_engine.h
@@ -295,23 +295,75 @@ class PDFEngineExports {
virtual ~PDFEngineExports() {}
static PDFEngineExports* Create();
#if defined(OS_WIN)
- // See the definition of RenderPDFPageToDC in pdf.cc for details.
+ // |pdf_buffer| is the buffer that contains the entire PDF document to be
+ // rendered.
+ // |buffer_size| is the size of |pdf_buffer| in bytes.
+ // |page_number| is the 0-based index of the page to be rendered.
+ // |dc| is the device context to render into.
Dan Beam 2014/07/09 23:18:24 remove from here down:
+ // |dpi_x| and |dpi_y| are the x and y resolutions respectively. If either
+ // value is -1, the dpi from the DC will be used.
+ // |bounds_origin_x|, |bounds_origin_y|, |bounds_width| and |bounds_height|
+ // specify a bounds rectangle within the DC in which to render the PDF
+ // page.
+ // |fit_to_bounds| specifies whether the output should be shrunk to fit the
+ // supplied bounds if the page size is larger than the bounds in any
+ // dimension. If this is false, parts of the PDF page that lie outside
+ // the bounds will be clipped.
+ // |stretch_to_bounds| specifies whether the output should be stretched to fit
+ // the supplied bounds if the page size is smaller than the bounds in any
+ // dimension.
+ // If both |fit_to_bounds| and |stretch_to_bounds| are true, then
+ // |fit_to_bounds| is honored first.
+ // |keep_aspect_ratio| If any scaling is to be done is true, this flag
+ // specifies whether the original aspect ratio of the page should be
+ // preserved while scaling.
+ // |center_in_bounds| specifies whether the final image (after any scaling is
+ // done) should be centered within the given bounds.
+ // |autorotate| specifies whether the final image should be rotated to match
+ // the output bound.
Dan Beam 2014/07/09 23:18:23 ^ to here
+ // Returns false if the document or the page number are not valid.
virtual bool RenderPDFPageToDC(const void* pdf_buffer,
int buffer_size,
int page_number,
const RenderingSettings& settings,
HDC dc) = 0;
#endif // OS_WIN
Dan Beam 2014/07/09 23:18:24 nit: \n
- // See the definition of RenderPDFPageToBitmap in pdf.cc for details.
+ // Renders PDF page into 4-byte per pixel BGRA color bitmap.
+ // |pdf_buffer| is the buffer that contains the entire PDF document to be
+ // rendered.
+ // |pdf_buffer_size| is the size of |pdf_buffer| in bytes.
+ // |page_number| is the 0-based index of the page to be rendered.
+ // |bitmap_buffer| is the output buffer for bitmap.
+ // |bitmap_width| is the width of the output bitmap.
Dan Beam 2014/07/09 23:18:24 I don't see |bitmap_width|, |bitmap_height|, |dpi|
+ // |bitmap_height| is the height of the output bitmap.
+ // |dpi| is the resolutions.
+ // |autorotate| specifies whether the final image should be rotated to match
+ // the output bound.
+ // Returns false if the document or the page number are not valid.
virtual bool RenderPDFPageToBitmap(const void* pdf_buffer,
int pdf_buffer_size,
int page_number,
const RenderingSettings& settings,
void* bitmap_buffer) = 0;
Dan Beam 2014/07/09 23:18:23 nit: \n
+ // |page_count| and |max_page_width| are optional and can be NULL.
+ // Returns false if the document is not valid.
virtual bool GetPDFDocInfo(const void* pdf_buffer,
int buffer_size,
int* page_count,
double* max_page_width) = 0;
+
+ // Gets the dimensions of a specific page in a document.
+ // |pdf_buffer| is the buffer that contains the entire PDF document to be
+ // rendered.
+ // |pdf_buffer_size| is the size of |pdf_buffer| in bytes.
+ // |page_number| is the page number that the function will get the dimensions
+ // of.
+ // |width| is the output for the width of the page in points.
+ // |height| is the output for the height of the page in points.
+ // Returns false if the document or the page number are not valid.
+ virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer,
+ int pdf_buffer_size, int page_number,
+ double* width, double* height) = 0;
};
} // namespace chrome_pdf
« no previous file with comments | « pdf/pdf.cc ('k') | pdf/pdfium/pdfium_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698