blob: c9d493bd2b151fc12776b53e7cc9750192a23a22 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module printing.mojom;
const string kServiceName = "pdf_compositor";
interface PdfCompositor {
// The status of composition and conversion execution.
enum Status {
SUCCESS,
HANDLE_MAP_ERROR,
CONTENT_FORMAT_ERROR,
COMPOSTING_FAILURE,
};
// Add the content of a subframe for composition.
// |frame_guid| is this subframe's global unique id.
// |serialized_content| points to a buffer of a serialized Skia picture which
// has the painted content of this frame.
// |subframe_content_map| records content id and its corresponding frame's
// global unique id.
AddSubframeContent(uint64 frame_guid, handle<shared_buffer> serialized_content,
map<uint32, uint64> subframe_content_info);
// Request to composite a page and convert it into a PDF file.
// |frame_guid| is the global unique id of the frame to be composited.
// |page_num| is zero-based sequence number of page.
// |sk_handle| points to a buffer of a Skia MultiPictureDocument which has
// the drawing content of this frame or a page of this frame.
// |subframe_content_map| records content id and its corresponding frame's
// global unique id.
CompositePageToPdf(uint64 frame_guid, uint32 page_num,
handle<shared_buffer> sk_handle,
map<uint32, uint64> subframe_content_info)
=> (Status status, handle<shared_buffer>? pdf_handle);
// Request to composite the entire document and convert it into a PDF file.
// All the arguments carry the same meaning as CompositePageToPdf() above,
// except this call doesn't have |page_num|.
CompositeDocumentToPdf(uint64 frame_guid, handle<shared_buffer> sk_handle,
map<uint32, uint64> subframe_content_info)
=> (Status status, handle<shared_buffer>? pdf_handle);
};