1 // Copyright 2018 The PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef SAMPLES_PDFIUM_TEST_WRITE_HELPER_H_ 6 #define SAMPLES_PDFIUM_TEST_WRITE_HELPER_H_ 7 8 #include <string> 9 10 #include "public/fpdfview.h" 11 12 #ifdef PDF_ENABLE_SKIA 13 #include "third_party/skia/include/core/SkPictureRecorder.h" 14 #include "third_party/skia/include/core/SkStream.h" 15 #endif 16 17 std::string WritePpm(const char* pdf_name, 18 int num, 19 void* buffer_void, 20 int stride, 21 int width, 22 int height); 23 void WriteText(FPDF_PAGE page, const char* pdf_name, int num); 24 void WriteAnnot(FPDF_PAGE page, const char* pdf_name, int num); 25 std::string WritePng(const char* pdf_name, 26 int num, 27 void* buffer, 28 int stride, 29 int width, 30 int height); 31 32 #ifdef _WIN32 33 std::string WriteBmp(const char* pdf_name, 34 int num, 35 void* buffer, 36 int stride, 37 int width, 38 int height); 39 void WriteEmf(FPDF_PAGE page, const char* pdf_name, int num); 40 void WritePS(FPDF_PAGE page, const char* pdf_name, int num); 41 #endif // _WIN32 42 43 #ifdef PDF_ENABLE_SKIA 44 std::string WriteSkp(const char* pdf_name, 45 int num, 46 SkPictureRecorder* recorder); 47 #endif // PDF_ENABLE_SKIA 48 49 void WriteAttachments(FPDF_DOCUMENT doc, const std::string& name); 50 void WriteImages(FPDF_PAGE page, const char* pdf_name, int page_num); 51 void WriteDecodedThumbnailStream(FPDF_PAGE page, 52 const char* pdf_name, 53 int page_num); 54 void WriteRawThumbnailStream(FPDF_PAGE page, 55 const char* pdf_name, 56 int page_num); 57 void WriteThumbnail(FPDF_PAGE page, const char* pdf_name, int page_num); 58 59 #endif // SAMPLES_PDFIUM_TEST_WRITE_HELPER_H_ 60