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
page_renderer.h
Go to the documentation of this file.
1// Copyright 2023 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#ifndef SAMPLES_HELPERS_PAGE_RENDERER_H_
6#define SAMPLES_HELPERS_PAGE_RENDERER_H_
7
8#include <string>
9
10#include "public/fpdfview.h"
11
12// Renderer for a single page.
14 public:
15 virtual ~PageRenderer();
16
17 // Returns `true` if the rendered output exists. Must call `Finish()` first.
18 virtual bool HasOutput() const = 0;
19
20 // Starts rendering the page, returning `false` on failure.
21 virtual bool Start() = 0;
22
23 // Continues rendering the page, returning `false` when complete.
24 virtual bool Continue();
25
26 // Finishes rendering the page.
27 virtual void Finish(FPDF_FORMHANDLE form) = 0;
28
29 // Writes rendered output to a file, returning `false` on failure.
30 virtual bool Write(const std::string& name, int page_index, bool md5) = 0;
31
32 protected:
33 PageRenderer(FPDF_PAGE page, int width, int height, int flags);
34
35 FPDF_PAGE page() { return page_; }
36 int width() const { return width_; }
37 int height() const { return height_; }
38 int flags() const { return flags_; }
39
40 private:
41 FPDF_PAGE page_;
42 int width_;
43 int height_;
44 int flags_;
45};
46
47#endif // SAMPLES_HELPERS_PAGE_RENDERER_H_
virtual ~PageRenderer()
virtual bool HasOutput() const =0
virtual bool Write(const std::string &name, int page_index, bool md5)=0
PageRenderer(FPDF_PAGE page, int width, int height, int flags)
int width() const
virtual bool Start()=0
virtual bool Continue()
virtual void Finish(FPDF_FORMHANDLE form)=0
int height() const
FPDF_PAGE page()
int flags() const