Exemple #1
0
void
pdf_puts(PDF *p, const char *s)
{
#ifdef PDFLIB_EBCDIC

    char buffer[LINEBUFLEN];

    strcpy(buffer, s);
    pdf_make_ascii(buffer);
    pdf_write(p, (void *) buffer, strlen(buffer));

#else

    pdf_write(p, (void *) s, strlen(s));

#endif	/* PDFLIB_EBCDIC */
}
Exemple #2
0
static void
pdf_write_header(PDF *p)
{
    /* Write the document header */
    /*
     * Although the %PDF-1.3 header also works with older Acrobat viewers,
     * we need a 1.2 header for special applications (controlled by the
     * client).
    */

    if (p->compatibility == PDF_1_4)
	pdf_puts(p, "%PDF-1.4\n");	      	/* PDF 1.4 header */
    else if (p->compatibility == PDF_1_3)
	pdf_puts(p, "%PDF-1.3\n");	      	/* PDF 1.3 header */
    else
	pdf_puts(p, "%PDF-1.2\n");	      	/* PDF 1.2 header */

    /* binary magic number */
    pdf_write(p, PDF_MAGIC_BINARY, sizeof(PDF_MAGIC_BINARY) - 1);
}
Exemple #3
0
void
pdf_putc(PDF *p, char c)
{
    pdf_write(p, (void *) &c, (size_t) 1);
}