private int write_pdf_page_content_stream()
{
string buffer = null;
int written = 0;
if (m_tiff_pages[m_pdf_page].page_tilecount > 0)
{
for (int i = 0; i < m_tiff_pages[m_pdf_page].page_tilecount; i++)
{
T2P_BOX box = m_tiff_pages[m_pdf_page].tiles_tiles[i].tile_box;
buffer = string.Format(CultureInfo.InvariantCulture,
"q {0} {1:F4} {2:F4} {3:F4} {4:F4} {5:F4} {6:F4} cm /Im{7}_{8} Do Q\n",
m_tiff_transferfunctioncount != 0 ? "/GS1 gs " : "", box.mat[0], box.mat[1],
box.mat[3], box.mat[4], box.mat[6], box.mat[7], m_pdf_page + 1, i + 1);
byte[] bytes = Latin1Encoding.GetBytes(buffer);
written += write_pdf_stream(bytes, bytes.Length);
}
}
else
{
T2P_BOX box = m_pdf_imagebox;
buffer = string.Format(CultureInfo.InvariantCulture,
"q {0} {1:F4} {2:F4} {3:F4} {4:F4} {5:F4} {6:F4} cm /Im{7} Do Q\n",
m_tiff_transferfunctioncount != 0 ? "/GS1 gs " : "", box.mat[0], box.mat[1],
box.mat[3], box.mat[4], box.mat[6], box.mat[7], m_pdf_page + 1);
byte[] bytes = Latin1Encoding.GetBytes(buffer);
written += write_pdf_stream(bytes, bytes.Length);
}
return written;
}