Lines Matching refs:page
31 // Open a file with one annotation and load its first page.
33 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
34 ASSERT_TRUE(page);
40 FPDF_BITMAP bitmap = RenderPageWithFlags(page, form_handle(), FPDF_ANNOT);
44 UnloadPage(page);
48 // Open a file with one annotation and load its first page.
50 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
51 ASSERT_TRUE(page);
53 // Check that there is a total of 1 annotation on its first page.
54 EXPECT_EQ(1, FPDFPage_GetAnnotCount(page));
57 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 0);
120 UnloadPage(page);
124 // Open a file with three annotations and load its first page.
126 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
127 ASSERT_TRUE(page);
129 // Check that there is a total of 3 annotation on its first page.
130 EXPECT_EQ(3, FPDFPage_GetAnnotCount(page));
133 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 2);
162 UnloadPage(page);
166 // Open a file with one annotation and load its first page.
168 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
169 ASSERT_TRUE(page);
172 ASSERT_FALSE(FPDFPage_CreateAnnot(page, -1));
174 UnloadPage(page);
178 // Open a file with no annotation and load its first page.
180 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
181 ASSERT_TRUE(page);
182 EXPECT_EQ(0, FPDFPage_GetAnnotCount(page));
184 // Add a text annotation to the page.
185 FPDF_ANNOTATION annot = FPDFPage_CreateAnnot(page, FPDF_ANNOT_TEXT);
188 // Check that there is now 1 annotations on this page.
189 EXPECT_EQ(1, FPDFPage_GetAnnotCount(page));
195 annot = FPDFPage_GetAnnot(page, 0);
255 UnloadPage(page);
259 // Open a file with one annotation and load its first page.
261 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
262 ASSERT_TRUE(page);
264 // Check that there is a total of one annotation on its first page, and verify
266 EXPECT_EQ(1, FPDFPage_GetAnnotCount(page));
267 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 0);
277 // Add an underline annotation to the page and set its quadpoints.
278 annot = FPDFPage_CreateAnnot(page, FPDF_ANNOT_UNDERLINE);
285 // Save the document, closing the page and document.
287 FPDF_ClosePage(page);
293 page = LoadSavedPage(0);
294 VerifySavedRendering(page, 612, 792, md5);
296 // Check that the saved document has 2 annotations on the first page
297 EXPECT_EQ(2, FPDFPage_GetAnnotCount(page));
301 FPDF_ANNOTATION new_annot = FPDFPage_GetAnnot(page, 1);
313 CloseSavedPage(page);
332 // Open a file with four annotations and load its first page.
334 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
335 ASSERT_TRUE(page);
336 EXPECT_EQ(4, FPDFPage_GetAnnotCount(page));
339 FPDF_BITMAP bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
344 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 0);
374 bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
396 bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
401 annot = FPDFPage_GetAnnot(page, 2);
414 bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
419 UnloadPage(page);
423 // Open a file with 3 annotations on its first page.
425 FPDF_PAGE page
426 ASSERT_TRUE(page);
427 EXPECT_EQ(3, FPDFPage_GetAnnotCount(page));
430 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 0);
436 annot = FPDFPage_GetAnnot(page, 1);
441 annot = FPDFPage_GetAnnot(page, 2);
448 EXPECT_FALSE(FPDFPage_RemoveAnnot(page, 4));
449 EXPECT_FALSE(FPDFPage_RemoveAnnot(page, -1));
450 EXPECT_EQ(3, FPDFPage_GetAnnotCount(page));
453 EXPECT_TRUE(FPDFPage_RemoveAnnot(page, 1));
454 EXPECT_EQ(2, FPDFPage_GetAnnotCount(page));
455 EXPECT_FALSE(FPDFPage_GetAnnot(page, 2));
457 // Save the document, closing the page and document.
459 FPDF_ClosePage(page);
474 // Check that the saved document has 2 annotations on the first page.
505 // Open a file with two annotations and load its first page.
507 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
508 ASSERT_TRUE(page);
509 EXPECT_EQ(2, FPDFPage_GetAnnotCount(page));
511 // Check that the page renders correctly.
512 FPDF_BITMAP bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
517 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 0);
532 // Check that the page with the modified annotation renders correctly.
533 bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
546 // Check that the page with an annotation with two paths renders correctly.
547 bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
556 // Check that the page renders the same as before.
557 bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
562 annot = FPDFPage_CreateAnnot(page, FPDF_ANNOT_STAMP);
591 // Save the document, closing the page and document.
594 FPDF_ClosePage(page);
598 page = LoadSavedPage(0);
599 VerifySavedRendering(page, 595, 842, md5_new_annot);
602 EXPECT_EQ(3, FPDFPage_GetAnnotCount(page));
603 annot = FPDFPage_GetAnnot(page, 2);
615 CloseSavedPage(page);
620 // Open a file with an annotation and load its first page.
622 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
623 ASSERT_TRUE(page);
625 // Check that the page renders correctly.
626 FPDF_BITMAP bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
631 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 0);
646 // Check that the page renders correctly without rendering the annotation.
647 bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
660 // Check that the page renders correctly as before.
661 bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
666 UnloadPage(page);
680 // Open a file with two annotations and load its first page.
682 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
683 ASSERT_TRUE(page);
684 EXPECT_EQ(2, FPDFPage_GetAnnotCount(page));
686 // Check that the page renders correctly.
687 FPDF_BITMAP bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
692 FPDF_ANNOTATION annot = FPDFPage_CreateAnnot(page, FPDF_ANNOT_STAMP);
708 ASSERT_TRUE(FPDFImageObj_SetBitmap(&page, 0, image_object, image_bitmap));
715 // Check that the page renders correctly with the new image object.
716 bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
721 annot = FPDFPage_GetAnnot(page, 2);
729 ASSERT_TRUE(FPDFImageObj_SetBitmap(&page, 0, image_object, image_bitmap));
733 // Save the document, closing the page and document.
735 FPDF_ClosePage(page);
753 // Open a file with two annotations and load its first page.
755 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
756 ASSERT_TRUE(page);
757 EXPECT_EQ(2, FPDFPage_GetAnnotCount(page));
759 // Check that the page renders correctly.
760 FPDF_BITMAP bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
765 FPDF_ANNOTATION annot = FPDFPage_CreateAnnot(page, FPDF_ANNOT_STAMP);
786 // Check that the page renders correctly with the new text object.
787 bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
792 annot = FPDFPage_GetAnnot(page, 2);
805 // Check that the page renders correctly with the modified text object.
806 bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
810 // Remove the new annotation, and check that the page renders as before.
811 EXPECT_TRUE(FPDFPage_RemoveAnnot(page, 2));
812 bitmap = RenderPageWithFlags(page, form_handle_, FPDF_ANNOT);
816 UnloadPage(page);
820 // Open a file with four annotations and load its first page.
822 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
823 ASSERT_TRUE(page);
826 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 0);
862 // Save the document, closing the page and document.
865 FPDF_ClosePage(page);
874 page = LoadSavedPage(0);
875 VerifySavedRendering(page, 595, 842, md5);
876 FPDF_ANNOTATION new_annot = FPDFPage_GetAnnot(page, 0);
888 CloseSavedPage(page);
893 // Open a file with four annotations and load its first page.
895 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
896 ASSERT_TRUE(page);
899 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 0);
984 FPDF_ClosePage(page);
987 page = LoadSavedPage(0);
988 FPDF_ANNOTATION new_annot = FPDFPage_GetAnnot(page, 0);
1003 CloseSavedPage(page);
1008 // Open a file with four annotations and load its first page.
1010 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
1011 ASSERT_TRUE(page);
1014 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 0);
1036 FPDF_ClosePage(page);
1040 // Open a file with four annotations and load its first page.
1042 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
1043 ASSERT_TRUE(page);
1046 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 0);
1068 FPDF_ClosePage(page);
1072 // Open a file with annotations and load its first page.
1074 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
1075 ASSERT_TRUE(page);
1076 EXPECT_EQ(-1, FPDFPage_GetAnnotIndex(page, nullptr));
1079 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 0);
1082 EXPECT_EQ(0, FPDFPage_GetAnnotIndex(page, annot));
1091 EXPECT_EQ(1, FPDFPage_GetAnnotIndex(page, popup));
1112 UnloadPage(page);
1118 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
1119 ASSERT_TRUE(page);
1122 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 0);
1126 int flags = FPDFAnnot_GetFormFieldFlags(page, annot);
1131 annot = FPDFPage_GetAnnot(page, 1);
1135 flags = FPDFAnnot_GetFormFieldFlags(page, annot);
1139 UnloadPage(page);
1145 FPDF_PAGE page = FPDF_LoadPage(document(), 0);
1146 ASSERT_TRUE(page);
1149 FPDF_ANNOTATION annot = FPDFPage_GetAnnot(page, 0);
1153 int flags = FPDFAnnot_GetFormFieldFlags(page, annot);
1160 annot = FPDFPage_GetAnnot(page, 1);
1164 flags = FPDFAnnot_GetFormFieldFlags(page, annot);
1171 annot = FPDFPage_GetAnnot(page, 2);
1175 flags = FPDFAnnot_GetFormFieldFlags(page, annot);
1181 UnloadPage(page);
1187 FPDF_PAGE page = LoadPage(0);
1188 ASSERT_TRUE(page);
1190 // Attempt to get an annotation where no annotation exists on page.
1192 FPDFAnnot_GetFormFieldAtPoint(form_handle(), page, 0, 0);
1195 UnloadPage(page);
1201 FPDF_PAGE page = LoadPage(0);
1202 ASSERT_TRUE(page);
1206 FPDFAnnot_GetFormFieldAtPoint(form_handle(), page, 105, 118);
1210 int flags = FPDFAnnot_GetFormFieldFlags(page, annot);
1215 annot = FPDFAnnot_GetFormFieldAtPoint(form_handle(), page, 105, 202);
1219 flags = FPDFAnnot_GetFormFieldFlags(page, annot);
1223 UnloadPage(page);
1229 FPDF_PAGE page = LoadPage(0);
1230 ASSERT_TRUE(page);
1234 FPDFAnnot_GetFormFieldAtPoint(form_handle(), page, 102, 63);
1238 int flags = FPDFAnnot_GetFormFieldFlags(page, annot);
1245 annot = FPDFAnnot_GetFormFieldAtPoint(form_handle(), page, 102, 113);
1249 flags = FPDFAnnot_GetFormFieldFlags(page, annot);
1256 annot = FPDFAnnot_GetFormFieldAtPoint(form_handle(), page, 102, 213);
1260 flags = FPDFAnnot_GetFormFieldFlags(page, annot);
1266 UnloadPage(page);