aboutsummaryrefslogtreecommitdiff
path: root/samples/pdfium_test_write_helper.h
blob: ffeba1f55d89e3d08a179adc8df7e8fbada96aa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright 2018 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SAMPLES_PDFIUM_TEST_WRITE_HELPER_H_
#define SAMPLES_PDFIUM_TEST_WRITE_HELPER_H_

#include <string>

#include "public/fpdfview.h"

#ifdef PDF_ENABLE_SKIA
class SkPicture;
#endif

std::string WritePpm(const char* pdf_name,
                     int num,
                     void* buffer_void,
                     int stride,
                     int width,
                     int height);
void WriteText(FPDF_TEXTPAGE textpage, const char* pdf_name, int num);
void WriteAnnot(FPDF_PAGE page, const char* pdf_name, int num);
std::string WritePng(const char* pdf_name,
                     int num,
                     void* buffer,
                     int stride,
                     int width,
                     int height);

#ifdef _WIN32
std::string WriteBmp(const char* pdf_name,
                     int num,
                     void* buffer,
                     int stride,
                     int width,
                     int height);
void WriteEmf(FPDF_PAGE page, const char* pdf_name, int num);
void WritePS(FPDF_PAGE page, const char* pdf_name, int num);
#endif  // _WIN32

#ifdef PDF_ENABLE_SKIA
std::string WriteSkp(const char* pdf_name, int num, const SkPicture& picture);
#endif  // PDF_ENABLE_SKIA

void WriteAttachments(FPDF_DOCUMENT doc, const std::string& name);
void WriteImages(FPDF_PAGE page, const char* pdf_name, int page_num);
void WriteRenderedImages(FPDF_DOCUMENT doc,
                         FPDF_PAGE page,
                         const char* pdf_name,
                         int page_num);
void WriteDecodedThumbnailStream(FPDF_PAGE page,
                                 const char* pdf_name,
                                 int page_num);
void WriteRawThumbnailStream(FPDF_PAGE page,
                             const char* pdf_name,
                             int page_num);
void WriteThumbnail(FPDF_PAGE page, const char* pdf_name, int page_num);

#endif  // SAMPLES_PDFIUM_TEST_WRITE_HELPER_H_