Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
fpdf_transformpage_embeddertest.cpp
Go to the documentation of this file.
1// Copyright 2018 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "public/fpdf_transformpage.h"
6
7#include "build/build_config.h"
8#include "core/fxge/cfx_defaultrenderdevice.h"
9#include "testing/embedder_test.h"
10#include "testing/embedder_test_constants.h"
11
12#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
13#include "third_party/base/test/scoped_locale.h"
14#endif
15
16using pdfium::RectanglesChecksum;
17
18namespace {
19
20const char* ShrunkChecksum() {
21 if (CFX_DefaultRenderDevice::UseSkiaRenderer()) {
22 return "78c52d6029283090036e6db6683401e2";
23 }
24 return "f4136cc9209207ab60eb8381a3df2e69";
25}
26
27} // namespace
28
30
32 ASSERT_TRUE(OpenDocument("cropped_text.pdf"));
33 ASSERT_EQ(4, FPDF_GetPageCount(document()));
34
35 {
36 FPDF_PAGE page = LoadPage(1);
37 ASSERT_TRUE(page);
38
39 FS_RECTF mediabox;
40 EXPECT_TRUE(FPDFPage_GetMediaBox(page, &mediabox.left, &mediabox.bottom,
41 &mediabox.right, &mediabox.top));
42 EXPECT_EQ(-50, mediabox.left);
43 EXPECT_EQ(-50, mediabox.bottom);
44 EXPECT_EQ(200, mediabox.right);
45 EXPECT_EQ(200, mediabox.top);
46
47 FS_RECTF cropbox;
48 EXPECT_TRUE(FPDFPage_GetCropBox(page, &cropbox.left, &cropbox.bottom,
49 &cropbox.right, &cropbox.top));
50 EXPECT_EQ(50, cropbox.left);
51 EXPECT_EQ(50, cropbox.bottom);
52 EXPECT_EQ(150, cropbox.right);
53 EXPECT_EQ(150, cropbox.top);
54
55 FS_RECTF bleedbox;
56 EXPECT_TRUE(FPDFPage_GetBleedBox(page, &bleedbox.left, &bleedbox.bottom,
57 &bleedbox.right, &bleedbox.top));
58 EXPECT_EQ(0, bleedbox.left);
59 EXPECT_EQ(10, bleedbox.bottom);
60 EXPECT_EQ(150, bleedbox.right);
61 EXPECT_EQ(145, bleedbox.top);
62
63 FS_RECTF trimbox;
64 EXPECT_TRUE(FPDFPage_GetTrimBox(page, &trimbox.left, &trimbox.bottom,
65 &trimbox.right, &trimbox.top));
66 EXPECT_EQ(25, trimbox.left);
67 EXPECT_EQ(30, trimbox.bottom);
68 EXPECT_EQ(140, trimbox.right);
69 EXPECT_EQ(145, trimbox.top);
70
71 FS_RECTF artbox;
72 EXPECT_TRUE(FPDFPage_GetArtBox(page, &artbox.left, &artbox.bottom,
73 &artbox.right, &artbox.top));
74 EXPECT_EQ(50, artbox.left);
75 EXPECT_EQ(60, artbox.bottom);
76 EXPECT_EQ(135, artbox.right);
77 EXPECT_EQ(140, artbox.top);
78
79 UnloadPage(page);
80 }
81
82 {
83 FPDF_PAGE page = LoadPage(3);
84 ASSERT_TRUE(page);
85
86 FS_RECTF mediabox;
87 EXPECT_TRUE(FPDFPage_GetMediaBox(page, &mediabox.left, &mediabox.bottom,
88 &mediabox.right, &mediabox.top));
89 EXPECT_EQ(0, mediabox.left);
90 EXPECT_EQ(0, mediabox.bottom);
91 EXPECT_EQ(200, mediabox.right);
92 EXPECT_EQ(200, mediabox.top);
93
94 FS_RECTF cropbox;
95 EXPECT_TRUE(FPDFPage_GetCropBox(page, &cropbox.left, &cropbox.bottom,
96 &cropbox.right, &cropbox.top));
97 EXPECT_EQ(150, cropbox.left);
98 EXPECT_EQ(150, cropbox.bottom);
99 EXPECT_EQ(60, cropbox.right);
100 EXPECT_EQ(60, cropbox.top);
101
102 EXPECT_FALSE(FPDFPage_GetCropBox(page, nullptr, &cropbox.bottom,
103 &cropbox.right, &cropbox.top));
104 EXPECT_FALSE(FPDFPage_GetCropBox(page, &cropbox.left, nullptr,
105 &cropbox.right, &cropbox.top));
106 EXPECT_FALSE(FPDFPage_GetCropBox(page, &cropbox.left, &cropbox.bottom,
107 nullptr, &cropbox.top));
108 EXPECT_FALSE(FPDFPage_GetCropBox(page, &cropbox.left, &cropbox.bottom,
109 &cropbox.right, nullptr));
110 EXPECT_FALSE(FPDFPage_GetCropBox(page, nullptr, nullptr, nullptr, nullptr));
111
112 FS_RECTF bleedbox;
113 EXPECT_TRUE(FPDFPage_GetBleedBox(page, &bleedbox.left, &bleedbox.bottom,
114 &bleedbox.right, &bleedbox.top));
115 EXPECT_EQ(160, bleedbox.left);
116 EXPECT_EQ(165, bleedbox.bottom);
117 EXPECT_EQ(0, bleedbox.right);
118 EXPECT_EQ(10, bleedbox.top);
119
120 FS_RECTF trimbox;
121 EXPECT_TRUE(FPDFPage_GetTrimBox(page, &trimbox.left, &trimbox.bottom,
122 &trimbox.right, &trimbox.top));
123 EXPECT_EQ(155, trimbox.left);
124 EXPECT_EQ(165, trimbox.bottom);
125 EXPECT_EQ(25, trimbox.right);
126 EXPECT_EQ(30, trimbox.top);
127
128 FS_RECTF artbox;
129 EXPECT_TRUE(FPDFPage_GetArtBox(page, &artbox.left, &artbox.bottom,
130 &artbox.right, &artbox.top));
131 EXPECT_EQ(140, artbox.left);
132 EXPECT_EQ(145, artbox.bottom);
133 EXPECT_EQ(65, artbox.right);
134 EXPECT_EQ(70, artbox.top);
135
136 UnloadPage(page);
137 }
138}
139
141 ASSERT_TRUE(OpenDocument("hello_world.pdf"));
142 ASSERT_EQ(1, FPDF_GetPageCount(document()));
143
144 FPDF_PAGE page = LoadPage(0);
145 ASSERT_TRUE(page);
146
147 FS_RECTF cropbox = {-1.0f, 0.0f, 3.0f, -2.0f};
148 EXPECT_FALSE(FPDFPage_GetCropBox(page, &cropbox.left, &cropbox.bottom,
149 &cropbox.right, &cropbox.top));
150 EXPECT_EQ(-1.0f, cropbox.left);
151 EXPECT_EQ(-2.0f, cropbox.bottom);
152 EXPECT_EQ(3.0f, cropbox.right);
153 EXPECT_EQ(0.0f, cropbox.top);
154
155 UnloadPage(page);
156}
157
159 ASSERT_TRUE(OpenDocument("hello_world.pdf"));
160 ASSERT_EQ(1, FPDF_GetPageCount(document()));
161
162 FPDF_PAGE page = LoadPage(0);
163 ASSERT_TRUE(page);
164
165 FS_RECTF bleedbox = {-1.0f, 10.f, 3.0f, -1.0f};
166 EXPECT_FALSE(FPDFPage_GetBleedBox(page, &bleedbox.left, &bleedbox.bottom,
167 &bleedbox.right, &bleedbox.top));
168 EXPECT_EQ(-1.0f, bleedbox.left);
169 EXPECT_EQ(-1.0f, bleedbox.bottom);
170 EXPECT_EQ(3.0f, bleedbox.right);
171 EXPECT_EQ(10.0f, bleedbox.top);
172
173 UnloadPage(page);
174}
175
177 ASSERT_TRUE(OpenDocument("hello_world.pdf"));
178 ASSERT_EQ(1, FPDF_GetPageCount(document()));
179
180 FPDF_PAGE page = LoadPage(0);
181 ASSERT_TRUE(page);
182
183 FS_RECTF trimbox = {-11.0f, 0.0f, 3.0f, -10.0f};
184 EXPECT_FALSE(FPDFPage_GetTrimBox(page, &trimbox.left, &trimbox.bottom,
185 &trimbox.right, &trimbox.top));
186 EXPECT_EQ(-11.0f, trimbox.left);
187 EXPECT_EQ(-10.0f, trimbox.bottom);
188 EXPECT_EQ(3.0f, trimbox.right);
189 EXPECT_EQ(0.0f, trimbox.top);
190
191 UnloadPage(page);
192}
193
195 ASSERT_TRUE(OpenDocument("hello_world.pdf"));
196 ASSERT_EQ(1, FPDF_GetPageCount(document()));
197
198 FPDF_PAGE page = LoadPage(0);
199 ASSERT_TRUE(page);
200
201 FS_RECTF artbox = {-1.0f, 0.0f, 3.0f, -1.0f};
202 EXPECT_FALSE(FPDFPage_GetArtBox(page, &artbox.left, &artbox.bottom,
203 &artbox.right, &artbox.top));
204 EXPECT_EQ(-1.0f, artbox.left);
205 EXPECT_EQ(-1.0f, artbox.bottom);
206 EXPECT_EQ(3.0f, artbox.right);
207 EXPECT_EQ(0.0f, artbox.top);
208
209 UnloadPage(page);
210}
211
213 const char* cropped_checksum = []() {
214 if (CFX_DefaultRenderDevice::UseSkiaRenderer()) {
215 return "4b9d2d2246be61c583f454245fe3172f";
216 }
217 return "9937883715d5144c079fb8f7e3d4f395";
218 }();
219 {
220 ASSERT_TRUE(OpenDocument("rectangles.pdf"));
221 FPDF_PAGE page = LoadPage(0);
222 ASSERT_TRUE(page);
223
224 {
225 // Render the page as is.
226 FS_RECTF cropbox;
227 EXPECT_FALSE(FPDFPage_GetCropBox(page, &cropbox.left, &cropbox.bottom,
228 &cropbox.right, &cropbox.top));
229 const int page_width = static_cast<int>(FPDF_GetPageWidth(page));
230 const int page_height = static_cast<int>(FPDF_GetPageHeight(page));
231 EXPECT_EQ(200, page_width);
232 EXPECT_EQ(300, page_height);
233 ScopedFPDFBitmap bitmap = RenderLoadedPage(page);
234 CompareBitmap(bitmap.get(), page_width, page_height,
236 }
237
238 FPDFPage_SetCropBox(page, 10, 20, 100, 150);
239
240 {
241 // Render the page after setting the CropBox.
242 // Note that the change affects the rendering, as expected.
243 // It behaves just like the case below, rather than the case above.
244 FS_RECTF cropbox;
245 EXPECT_TRUE(FPDFPage_GetCropBox(page, &cropbox.left, &cropbox.bottom,
246 &cropbox.right, &cropbox.top));
247 EXPECT_EQ(10, cropbox.left);
248 EXPECT_EQ(20, cropbox.bottom);
249 EXPECT_EQ(100, cropbox.right);
250 EXPECT_EQ(150, cropbox.top);
251 const int page_width = static_cast<int>(FPDF_GetPageWidth(page));
252 const int page_height = static_cast<int>(FPDF_GetPageHeight(page));
253 EXPECT_EQ(90, page_width);
254 EXPECT_EQ(130, page_height);
255 ScopedFPDFBitmap bitmap = RenderLoadedPage(page);
256 CompareBitmap(bitmap.get(), page_width, page_height, cropped_checksum);
257 }
258
259 UnloadPage(page);
260 }
261
262 {
263 // Save a copy, open the copy, and render it.
264 // Note that it renders the rotation.
265 EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0));
266 ASSERT_TRUE(OpenSavedDocument());
267 FPDF_PAGE saved_page = LoadSavedPage(0);
268 ASSERT_TRUE(saved_page);
269
270 FS_RECTF cropbox;
271 EXPECT_TRUE(FPDFPage_GetCropBox(saved_page, &cropbox.left, &cropbox.bottom,
272 &cropbox.right, &cropbox.top));
273 EXPECT_EQ(10, cropbox.left);
274 EXPECT_EQ(20, cropbox.bottom);
275 EXPECT_EQ(100, cropbox.right);
276 EXPECT_EQ(150, cropbox.top);
277 const int page_width = static_cast<int>(FPDF_GetPageWidth(saved_page));
278 const int page_height = static_cast<int>(FPDF_GetPageHeight(saved_page));
279 EXPECT_EQ(90, page_width);
280 EXPECT_EQ(130, page_height);
281 ScopedFPDFBitmap bitmap = RenderSavedPage(saved_page);
282 CompareBitmap(bitmap.get(), page_width, page_height, cropped_checksum);
283
284 CloseSavedPage(saved_page);
285 CloseSavedDocument();
286 }
287}
288
290 const char* shrunk_checksum_set_media_box = []() {
291 if (CFX_DefaultRenderDevice::UseSkiaRenderer()) {
292 return "9f28f0610a7f789c24cfd5f9bd5dc3de";
293 }
294 return "eab5958f62f7ce65d7c32de98389fee1";
295 }();
296
297 {
298 ASSERT_TRUE(OpenDocument("rectangles.pdf"));
299 FPDF_PAGE page = LoadPage(0);
300 ASSERT_TRUE(page);
301
302 {
303 // Render the page as is.
304 FS_RECTF mediabox;
305 EXPECT_FALSE(FPDFPage_GetMediaBox(page, &mediabox.left, &mediabox.bottom,
306 &mediabox.right, &mediabox.top));
307 const int page_width = static_cast<int>(FPDF_GetPageWidth(page));
308 const int page_height = static_cast<int>(FPDF_GetPageHeight(page));
309 EXPECT_EQ(200, page_width);
310 EXPECT_EQ(300, page_height);
311 ScopedFPDFBitmap bitmap = RenderLoadedPage(page);
312 CompareBitmap(bitmap.get(), page_width, page_height,
314 }
315
316 FPDFPage_SetMediaBox(page, 20, 30, 100, 150);
317
318 {
319 // Render the page after setting the MediaBox.
320 // Note that the change affects the rendering, as expected.
321 // It behaves just like the case below, rather than the case above.
322 FS_RECTF mediabox;
323 EXPECT_TRUE(FPDFPage_GetMediaBox(page, &mediabox.left, &mediabox.bottom,
324 &mediabox.right, &mediabox.top));
325 EXPECT_EQ(20, mediabox.left);
326 EXPECT_EQ(30, mediabox.bottom);
327 EXPECT_EQ(100, mediabox.right);
328 EXPECT_EQ(150, mediabox.top);
329 const int page_width = static_cast<int>(FPDF_GetPageWidth(page));
330 const int page_height = static_cast<int>(FPDF_GetPageHeight(page));
331 EXPECT_EQ(80, page_width);
332 EXPECT_EQ(120, page_height);
333 ScopedFPDFBitmap bitmap = RenderLoadedPage(page);
334 CompareBitmap(bitmap.get(), page_width, page_height,
335 shrunk_checksum_set_media_box);
336 }
337
338 UnloadPage(page);
339 }
340
341 {
342 // Save a copy, open the copy, and render it.
343 // Note that it renders the rotation.
344 EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0));
345 ASSERT_TRUE(OpenSavedDocument());
346 FPDF_PAGE saved_page = LoadSavedPage(0);
347 ASSERT_TRUE(saved_page);
348
349 FS_RECTF mediabox;
350 EXPECT_TRUE(FPDFPage_GetMediaBox(saved_page, &mediabox.left,
351 &mediabox.bottom, &mediabox.right,
352 &mediabox.top));
353 EXPECT_EQ(20, mediabox.left);
354 EXPECT_EQ(30, mediabox.bottom);
355 EXPECT_EQ(100, mediabox.right);
356 EXPECT_EQ(150, mediabox.top);
357 const int page_width = static_cast<int>(FPDF_GetPageWidth(saved_page));
358 const int page_height = static_cast<int>(FPDF_GetPageHeight(saved_page));
359 EXPECT_EQ(80, page_width);
360 EXPECT_EQ(120, page_height);
361 ScopedFPDFBitmap bitmap = RenderSavedPage(saved_page);
362 CompareBitmap(bitmap.get(), page_width, page_height,
363 shrunk_checksum_set_media_box);
364
365 CloseSavedPage(saved_page);
366 CloseSavedDocument();
367 }
368}
369
371 ASSERT_TRUE(OpenDocument("hello_world.pdf"));
372
373 FPDF_PAGE page = LoadPage(0);
374 ASSERT_TRUE(page);
375
376 {
377 ScopedFPDFClipPath clip(FPDF_CreateClipPath(10.0f, 10.0f, 90.0f, 90.0f));
378 EXPECT_TRUE(clip);
379
380 // NULL arg call is a no-op.
381 FPDFPage_InsertClipPath(nullptr, clip.get());
382
383 // Do actual work.
384 FPDFPage_InsertClipPath(page, clip.get());
385
386 // TODO(tsepez): test how inserting path affects page rendering.
387 }
388
389 UnloadPage(page);
390}
391
393 const FS_MATRIX half_matrix{0.5, 0, 0, 0.5, 0, 0};
394 const FS_RECTF clip_rect = {0.0f, 0.0f, 20.0f, 10.0f};
395
396 ASSERT_TRUE(OpenDocument("hello_world.pdf"));
397
398 FPDF_PAGE page = LoadPage(0);
399 ASSERT_TRUE(page);
400
401 EXPECT_FALSE(FPDFPage_TransFormWithClip(nullptr, nullptr, nullptr));
402 EXPECT_FALSE(FPDFPage_TransFormWithClip(nullptr, &half_matrix, nullptr));
403 EXPECT_FALSE(FPDFPage_TransFormWithClip(nullptr, nullptr, &clip_rect));
404 EXPECT_FALSE(FPDFPage_TransFormWithClip(nullptr, &half_matrix, &clip_rect));
405 EXPECT_FALSE(FPDFPage_TransFormWithClip(page, nullptr, nullptr));
406 EXPECT_TRUE(FPDFPage_TransFormWithClip(page, &half_matrix, nullptr));
407 EXPECT_TRUE(FPDFPage_TransFormWithClip(page, nullptr, &clip_rect));
408 EXPECT_TRUE(FPDFPage_TransFormWithClip(page, &half_matrix, &clip_rect));
409
410 UnloadPage(page);
411}
412
414 const FS_MATRIX half_matrix{0.5, 0, 0, 0.5, 0, 0};
415 const FS_RECTF clip_rect = {0.0f, 0.0f, 20.0f, 10.0f};
416
417 ASSERT_TRUE(OpenDocument("bug_547706.pdf"));
418
419 FPDF_PAGE page = LoadPage(0);
420 ASSERT_TRUE(page);
421
422 EXPECT_TRUE(FPDFPage_TransFormWithClip(page, &half_matrix, nullptr));
423 EXPECT_TRUE(FPDFPage_TransFormWithClip(page, nullptr, &clip_rect));
424 EXPECT_TRUE(FPDFPage_TransFormWithClip(page, &half_matrix, &clip_rect));
425
426 UnloadPage(page);
427}
428
430 {
431 ASSERT_TRUE(OpenDocument("rectangles.pdf"));
432 FPDF_PAGE page = LoadPage(0);
433 ASSERT_TRUE(page);
434
435 {
436 // Render the page as is.
437 const int page_width = static_cast<int>(FPDF_GetPageWidth(page));
438 const int page_height = static_cast<int>(FPDF_GetPageHeight(page));
439 EXPECT_EQ(200, page_width);
440 EXPECT_EQ(300, page_height);
441 ScopedFPDFBitmap bitmap = RenderLoadedPage(page);
442 CompareBitmap(bitmap.get(), page_width, page_height,
444 }
445
446 {
447 // Render the page after transforming.
448 // Note that the change should affect the rendering, but does not.
449 // It should behaves just like the case below, rather than the case above.
450 // TODO(crbug.com/pdfium/1328): The checksum after invoking
451 // `FPDFPage_TransFormWithClip()` below should match `ShrunkChecksum()`.
452 const FS_MATRIX half_matrix{0.5, 0, 0, 0.5, 0, 0};
453 EXPECT_TRUE(FPDFPage_TransFormWithClip(page, &half_matrix, nullptr));
454 const int page_width = static_cast<int>(FPDF_GetPageWidth(page));
455 const int page_height = static_cast<int>(FPDF_GetPageHeight(page));
456 EXPECT_EQ(200, page_width);
457 EXPECT_EQ(300, page_height);
458 ScopedFPDFBitmap bitmap = RenderLoadedPage(page);
459 CompareBitmap(bitmap.get(), page_width, page_height,
461 }
462
463 UnloadPage(page);
464 }
465
466 {
467 // Save a copy, open the copy, and render it.
468 // Note that it renders the transform.
469 EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0));
470 ASSERT_TRUE(OpenSavedDocument());
471 FPDF_PAGE saved_page = LoadSavedPage(0);
472 ASSERT_TRUE(saved_page);
473
474 const int page_width = static_cast<int>(FPDF_GetPageWidth(saved_page));
475 const int page_height = static_cast<int>(FPDF_GetPageHeight(saved_page));
476 EXPECT_EQ(200, page_width);
477 EXPECT_EQ(300, page_height);
478 ScopedFPDFBitmap bitmap = RenderSavedPage(saved_page);
479 CompareBitmap(bitmap.get(), page_width, page_height, ShrunkChecksum());
480
481 CloseSavedPage(saved_page);
482 CloseSavedDocument();
483 }
484}
485
486#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
487TEST_F(FPDFTransformEmbedderTest, TransFormWithClipAndSaveWithLocale) {
488 pdfium::base::ScopedLocale scoped_locale("da_DK.UTF-8");
489
490 {
491 ASSERT_TRUE(OpenDocument("rectangles.pdf"));
492 FPDF_PAGE page = LoadPage(0);
493 ASSERT_TRUE(page);
494
495 {
496 // Render the page as is.
497 const int page_width = static_cast<int>(FPDF_GetPageWidth(page));
498 const int page_height = static_cast<int>(FPDF_GetPageHeight(page));
499 EXPECT_EQ(200, page_width);
500 EXPECT_EQ(300, page_height);
501 ScopedFPDFBitmap bitmap = RenderLoadedPage(page);
502 CompareBitmap(bitmap.get(), page_width, page_height,
503 RectanglesChecksum());
504 }
505
506 {
507 // Render the page after transforming.
508 // Note that the change should affect the rendering, but does not.
509 // It should behaves just like the case below, rather than the case above.
510 // TODO(crbug.com/pdfium/1328): The checksum after invoking
511 // `FPDFPage_TransFormWithClip()` below should match `ShrunkChecksum()`.
512 const FS_MATRIX half_matrix{0.5, 0, 0, 0.5, 0, 0};
513 EXPECT_TRUE(FPDFPage_TransFormWithClip(page, &half_matrix, nullptr));
514 const int page_width = static_cast<int>(FPDF_GetPageWidth(page));
515 const int page_height = static_cast<int>(FPDF_GetPageHeight(page));
516 EXPECT_EQ(200, page_width);
517 EXPECT_EQ(300, page_height);
518 ScopedFPDFBitmap bitmap = RenderLoadedPage(page);
519 CompareBitmap(bitmap.get(), page_width, page_height,
520 RectanglesChecksum());
521 }
522
523 UnloadPage(page);
524 }
525
526 {
527 // Save a copy, open the copy, and render it.
528 // Note that it renders the transform.
529 EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0));
530 ASSERT_TRUE(OpenSavedDocument());
531 FPDF_PAGE saved_page = LoadSavedPage(0);
532 ASSERT_TRUE(saved_page);
533
534 const int page_width = static_cast<int>(FPDF_GetPageWidth(saved_page));
535 const int page_height = static_cast<int>(FPDF_GetPageHeight(saved_page));
536 EXPECT_EQ(200, page_width);
537 EXPECT_EQ(300, page_height);
538 ScopedFPDFBitmap bitmap = RenderSavedPage(saved_page);
539 CompareBitmap(bitmap.get(), page_width, page_height, ShrunkChecksum());
540
541 CloseSavedPage(saved_page);
542 CloseSavedDocument();
543 }
544}
545#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
546 // BUILDFLAG(IS_FUCHSIA)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetArtBox(FPDF_PAGE page, float *left, float *bottom, float *right, float *top)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetTrimBox(FPDF_PAGE page, float *left, float *bottom, float *right, float *top)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetMediaBox(FPDF_PAGE page, float *left, float *bottom, float *right, float *top)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetCropBox(FPDF_PAGE page, float *left, float *bottom, float *right, float *top)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_TransFormWithClip(FPDF_PAGE page, const FS_MATRIX *matrix, const FS_RECTF *clipRect)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetBleedBox(FPDF_PAGE page, float *left, float *bottom, float *right, float *top)
FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bottom, float right, float top)
FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetCropBox(FPDF_PAGE page, float left, float bottom, float right, float top)
TEST_F(FPDFTransformEmbedderTest, GetBoundingBoxes)
FPDF_EXPORT double FPDF_CALLCONV FPDF_GetPageWidth(FPDF_PAGE page)
FPDF_EXPORT double FPDF_CALLCONV FPDF_GetPageHeight(FPDF_PAGE page)
const char * RectanglesChecksum()