22 ASSERT_TRUE(OpenDocument(
"annotation_stamp_with_ap.pdf"));
24 EXPECT_TRUE(FPDF_SaveAsCopy(document(),
this, 0));
25 const std::string saved_doc_1 = GetString();
30 ASSERT_GE(1, FPDF_GetPageCount(document()));
31 FPDF_PAGE page = LoadPage(0);
33 ScopedFPDFBitmap bitmap = RenderLoadedPageWithFlags(page,
FPDF_ANNOT);
34 EXPECT_EQ(595, FPDFBitmap_GetWidth(bitmap.get()));
35 EXPECT_EQ(842, FPDFBitmap_GetHeight(bitmap.get()));
40 EXPECT_TRUE(FPDF_SaveAsCopy(document(),
this, 0));
41 const std::string saved_doc_2 = GetString();
45 EXPECT_EQ(saved_doc_1.size(), saved_doc_2.size());
49 ASSERT_TRUE(OpenDocument(
"embedded_attachments.pdf"));
50 EXPECT_TRUE(FPDF_SaveAsCopy(document(),
this, 0));
53 std::string saved_data = GetString();
54 const char kTrailerBeforeSecondID[] =
55 "trailer\r\n<</Info 9 0 R /Root 11 0 R /Size "
56 "36/ID[<D889EB6B9ADF88E5EDA7DC08FE85978B><";
57 ASSERT_THAT(saved_data, testing::HasSubstr(kTrailerBeforeSecondID));
58 size_t trailer_start = saved_data.find(kTrailerBeforeSecondID);
59 constexpr size_t kIdLen = 32;
60 size_t trailer_continuation =
61 trailer_start + strlen(kTrailerBeforeSecondID) + kIdLen;
62 std::string data_after_second_id = saved_data.substr(trailer_continuation);
63 EXPECT_THAT(data_after_second_id, testing::StartsWith(
">]>>\r\n"));
67 FileAccessForTesting file_acc(
"linearized.pdf");
76 SetDocumentFromAvail();
77 ASSERT_TRUE(document());
87 EXPECT_TRUE(FPDF_SaveAsCopy(document(),
this, 0));
88 const std::string saved_doc = GetString();
90 EXPECT_THAT(saved_doc, ::testing::HasSubstr(
"/Info"));