| | 489 | void |
| | 490 | PDFDocument::outputPostscriptBegin (const gchar *fileName, guint numOfPages, |
| | 491 | gfloat pageWidth, gfloat pageHeight) |
| | 492 | { |
| | 493 | if ( NULL != m_Document ) |
| | 494 | { |
| | 495 | if ( NULL != m_PostScript ) |
| | 496 | { |
| | 497 | outputPostscriptEnd (); |
| | 498 | } |
| | 499 | m_PostScript = |
| | 500 | poppler_ps_file_new (m_Document, fileName, 0, numOfPages); |
| | 501 | if ( NULL != m_PostScript ) |
| | 502 | { |
| | 503 | poppler_ps_file_set_paper_size (m_PostScript, |
| | 504 | pageWidth, pageHeight); |
| | 505 | } |
| | 506 | } |
| | 507 | } |
| | 508 | |
| | 509 | void |
| | 510 | PDFDocument::outputPostscriptEnd () |
| | 511 | { |
| | 512 | if ( NULL != m_PostScript ) |
| | 513 | { |
| | 514 | poppler_ps_file_free (m_PostScript); |
| | 515 | m_PostScript = NULL; |
| | 516 | } |
| | 517 | } |
| | 518 | |
| | 519 | void |
| | 520 | PDFDocument::outputPostscriptPage (guint pageNum) |
| | 521 | { |
| | 522 | if ( NULL != m_Document && NULL != m_PostScript ) |
| | 523 | { |
| | 524 | PopplerPage *page = poppler_document_get_page (m_Document, pageNum - 1); |
| | 525 | if ( NULL != page ) |
| | 526 | { |
| | 527 | poppler_page_render_to_ps (page, m_PostScript); |
| | 528 | } |
| | 529 | } |
| | 530 | } |
| | 531 | |
| | 532 | |