QPDFWriter::writeStandard()
{
    if (this->m->deterministic_id)
    {
        pushMD5Pipeline();
    }

    // Start writing

    writeHeader();
    writeString(this->m->extra_header_text);

    if (this->m->pclm)
    {
        enqueueObjectsPCLm();
    }
    else
    {
        enqueueObjectsStandard();
    }

    // Now start walking queue, outputting each object.
    while (this->m->object_queue.size())
    {
	QPDFObjectHandle cur_object = this->m->object_queue.front();
	this->m->object_queue.pop_front();
	writeObject(cur_object);
    }

    // Write out the encryption dictionary, if any
    if (this->m->encrypted)
    {
	writeEncryptionDictionary();
    }

    // Now write out xref.  next_objid is now the number of objects.
    qpdf_offset_t xref_offset = this->m->pipeline->getCount();
    if (this->m->object_stream_to_objects.empty())
    {
	// Write regular cross-reference table
	writeXRefTable(t_normal, 0, this->m->next_objid - 1,
                       this->m->next_objid);
    }
    else
    {
	// Write cross-reference stream.
	int xref_id = this->m->next_objid++;
	writeXRefStream(xref_id, xref_id, xref_offset, t_normal,
			0, this->m->next_objid - 1, this->m->next_objid);
    }
    writeString("startxref\n");
    writeString(QUtil::int_to_string(xref_offset));
    writeString("\n%%EOF\n");

    if (this->m->deterministic_id)
    {
	QTC::TC("qpdf", "QPDFWriter standard deterministic ID",
                this->m->object_stream_to_objects.empty() ? 0 : 1);
        popPipelineStack();
        assert(this->m->md5_pipeline == 0);
    }
}
QPDFWriter::writeStandard()
{
    if (this->m->deterministic_id)
    {
        pushMD5Pipeline();
    }

     

    writeHeader();
    writeString(this->m->extra_header_text);

    if (this->m->pclm)
    {
        enqueueObjectsPCLm();
    }
    else
    {
        enqueueObjectsStandard();
    }

     
    while (this->m->object_queue.size())
    {
	QPDFObjectHandle cur_object = this->m->object_queue.front();
	this->m->object_queue.pop_front();
	writeObject(cur_object);
    }

     
    if (this->m->encrypted)
    {
	writeEncryptionDictionary();
    }

     
    qpdf_offset_t xref_offset = this->m->pipeline->getCount();
    if (this->m->object_stream_to_objects.empty())
    {
	 
	writeXRefTable(t_normal, 0, this->m->next_objid - 1,
                       this->m->next_objid);
    }
    else
    {
	 
	int xref_id = this->m->next_objid++;
	writeXRefStream(xref_id, xref_id, xref_offset, t_normal,
			0, this->m->next_objid - 1, this->m->next_objid);
    }
    writeString("startxref\n");
    writeString(QUtil::int_to_string(xref_offset));
    writeString("\n%%EOF\n");

    if (this->m->deterministic_id)
    {
	QTC::TC("qpdf", "QPDFWriter standard deterministic ID",
                this->m->object_stream_to_objects.empty() ? 0 : 1);
        popPipelineStack();
        assert(this->m->md5_pipeline == 0);
    }
}