18bool CPSOutput::
WriteBlock(pdfium::span<
const uint8_t> input) {
19 while (!input.empty()) {
21 size_t send_len = std::min<size_t>(input.size(), 1024);
22 *(
reinterpret_cast<uint16_t*>(buffer)) =
static_cast<uint16_t>(send_len);
23 memcpy(buffer + 2, input.data(), send_len);
25 case OutputMode::kExtEscape:
26 ExtEscape(m_hDC, PASSTHROUGH,
static_cast<
int>(send_len + 2),
27 reinterpret_cast<
const char*>(buffer), 0,
nullptr);
29 case OutputMode::kGdiComment:
30 GdiComment(m_hDC,
static_cast<UINT>(send_len + 2), buffer);
33 input = input.subspan(send_len);