Пример #1
0
void
pdf_concat_raw(PDF *p, pdc_matrix *m)
{
    if (!pdc_is_identity_matrix(m))
    {
        char sa[32], sb[32], sc[32], sd[32];

        pdc_sprintf(p->pdc, pdc_true, sa, "%f", m->a);
        pdc_sprintf(p->pdc, pdc_true, sb, "%f", m->b);
        pdc_sprintf(p->pdc, pdc_true, sc, "%f", m->c);
        pdc_sprintf(p->pdc, pdc_true, sd, "%f", m->d);

        if ((!strcmp(sa, "0") || !strcmp(sd, "0")) &&
            (!strcmp(sb, "0") || !strcmp(sc, "0")))
        {
            pdc_error(p->pdc, PDC_E_ILLARG_MATRIX,
                      pdc_errprintf(p->pdc, "%f %f %f %f %f %f",
                                    m->a, m->b, m->c, m->d, m->e, m->f),
                      0, 0, 0);
        }

        pdf_end_text(p);

        pdc_printf(p->out, "%s %s %s %s %f %f cm\n",
                   sa, sb, sc, sd, m->e, m->f);

        pdc_multiply_matrix(m, &p->curr_ppt->gstate[p->curr_ppt->sl].ctm);
    }
}
Пример #2
0
void
pdf_concat_raw_ob(PDF *p, pdc_matrix *m, pdc_bool blind)
{
    if (!blind)
        pdf_concat_raw(p, m);
    else
        pdc_multiply_matrix(m, &p->gstate[p->sl].ctm);
}
Пример #3
0
void
pdf_setmatrix_e(PDF *p, pdc_matrix *n)
{
    pdc_matrix m;

    pdc_invert_matrix(p->pdc, &m, &p->curr_ppt->gstate[p->curr_ppt->sl].ctm);
    pdc_multiply_matrix(n, &m);
    pdf_concat_raw(p, &m);
}
Пример #4
0
void
pdf_get_mbox_rectangle(PDF *p, pdf_mbox *mbox, pdc_vector *polyline)
{
    pdc_matrix ctminv;

    pdc_invert_matrix(p->pdc, &ctminv,
                      &p->curr_ppt->gstate[p->curr_ppt->sl].ctm);
    pdc_multiply_matrix(&mbox->ctm, &ctminv);
    pdc_rect2polyline(&ctminv, &mbox->rect, polyline);
}
Пример #5
0
void
pdf_concat_raw(PDF *p, pdc_matrix *m)
{
    if (pdc_is_identity_matrix(m))
	return;

    pdf_end_text(p);

    pdc_printf(p->out, "%f %f %f %f %f %f cm\n",
		    m->a, m->b, m->c, m->d, m->e, m->f);

    pdc_multiply_matrix(m, &p->gstate[p->sl].ctm);
}
Пример #6
0
void
pdf_set_topdownsystem(PDF *p, pdc_scalar height)
{
    if (p->ydirection < 0)
    {
        pdc_matrix m, sm;

        pdc_translation_matrix(0, height, &m);
        pdc_scale_matrix(1, -1, &sm);
        pdc_multiply_matrix(&sm, &m);
        pdf_concat_raw(p, &m);
    }
}