static void create_pdf(char const* filename)
{
    QPDF pdf;

    // Start with an empty PDF that has no pages or non-required objects.
    pdf.emptyPDF();

    // Add an indirect object to contain a font descriptor for the
    // built-in Helvetica font.
    QPDFObjectHandle font = pdf.makeIndirectObject(
        QPDFObjectHandle::parse(
            "<<"
            " /Type /Font"
            " /Subtype /Type1"
            " /Name /F1"
            " /BaseFont /Helvetica"
            " /Encoding /WinAnsiEncoding"
            ">>"));

    std::vector<std::string> color_spaces;
    color_spaces.push_back("/DeviceCMYK");
    color_spaces.push_back("/DeviceRGB");
    color_spaces.push_back("/DeviceGray");
    std::vector<std::string> filters;
    filters.push_back("null");
    filters.push_back("/DCTDecode");
    filters.push_back("/RunLengthDecode");
    QPDFPageDocumentHelper dh(pdf);
    for (std::vector<std::string>::iterator c_iter = color_spaces.begin();
         c_iter != color_spaces.end(); ++c_iter)
    {
        for (std::vector<std::string>::iterator f_iter = filters.begin();
             f_iter != filters.end(); ++f_iter)
        {
            add_page(dh, font, *c_iter, *f_iter);
        }
    }

    QPDFWriter w(pdf, filename);
    w.write();

    // For test suite, verify that everything is the way it is
    // supposed to be.
    check(filename, color_spaces, filters);
}
static void create_pdf(char const* filename)
{
    QPDF pdf;

     
    pdf.emptyPDF();

     
     
    QPDFObjectHandle font = pdf.makeIndirectObject(
        QPDFObjectHandle::parse(
            "<<"
            " /Type /Font"
            " /Subtype /Type1"
            " /Name /F1"
            " /BaseFont /Helvetica"
            " /Encoding /WinAnsiEncoding"
            ">>"));

    std::vector<std::string> color_spaces;
    color_spaces.push_back("/DeviceCMYK");
    color_spaces.push_back("/DeviceRGB");
    color_spaces.push_back("/DeviceGray");
    std::vector<std::string> filters;
    filters.push_back("null");
    filters.push_back("/DCTDecode");
    filters.push_back("/RunLengthDecode");
    QPDFPageDocumentHelper dh(pdf);
    for (std::vector<std::string>::iterator c_iter = color_spaces.begin();
         c_iter != color_spaces.end(); ++c_iter)
    {
        for (std::vector<std::string>::iterator f_iter = filters.begin();
             f_iter != filters.end(); ++f_iter)
        {
            add_page(dh, font, *c_iter, *f_iter);
        }
    }

    QPDFWriter w(pdf, filename);
    w.write();

     
     
    check(filename, color_spaces, filters);
}