Commit b9faacc6 authored by Albert Astals Cid's avatar Albert Astals Cid

* qt4/src/poppler-document.cc

        * qt4/src/poppler-qt4.h: Add int marginRight, int marginBottom, int
        marginLeft, int marginTop, bool strictMargins to Document::print()
parent da8e6d4c
2006-11-18 Albert Astals Cid <aacid@kde.org>
* qt4/src/poppler-document.cc
* qt4/src/poppler-qt4.h: Add int marginRight, int marginBottom, int
marginLeft, int marginTop, bool strictMargins to Document::print()
2006-11-15 Albert Astals Cid <aacid@kde.org>
* qt4/src/Mainpage.dox:
......
......@@ -386,9 +386,16 @@ namespace Poppler {
return ld;
}
bool Document::print(const QString &file, const QList<int> pageList, double hDPI, double vDPI, int rotate, int paperWidth, int paperHeight)
bool Document::print(const QString &file, const QList<int> pageList, double hDPI, double vDPI, int rotate, int paperWidth, int paperHeight, int marginRight, int marginBottom, int marginLeft, int marginTop, bool strictMargins)
{
PSOutputDev *psOut = new PSOutputDev(file.toLatin1().data(), m_doc->doc.getXRef(), m_doc->doc.getCatalog(), 1, m_doc->doc.getNumPages(), psModePS, paperWidth, paperHeight, gFalse);
PSOutputDev *psOut = new PSOutputDev(file.toLatin1().data(), m_doc->doc.getXRef(), m_doc->doc.getCatalog(), 1, m_doc->doc.getNumPages(), psModePS, paperWidth, paperHeight, gFalse, marginRight, marginBottom, paperWidth - marginLeft, paperHeight - marginTop);
if (strictMargins)
{
double xScale = ((double)paperWidth - (double)marginLeft - (double)marginRight) / (double)paperWidth;
double yScale = ((double)paperHeight - (double)marginBottom - (double)marginTop) / (double)paperHeight;
psOut->setScale(xScale, yScale);
}
if (psOut->isOk())
{
......
......@@ -667,6 +667,10 @@ QString subject = m_doc->info("Subject");
/**
Prints the document to the PostScript file \p fileName
Sizes have to be in Points (1/72 inch)
\param strictMargins defines if margins have to be scrictly
followed (even if that means changing aspect ratio) or
if the margins can be adapted to keep aspect ratio
If you are using QPrinter you can get paper size by doing:
\code
......@@ -677,7 +681,7 @@ width = dummy.width();
height = dummy.height();
\endcode
*/
bool print(const QString &fileName, const QList<int> pageList, double hDPI, double vDPI, int rotate, int paperWidth, int paperHeight);
bool print(const QString &fileName, const QList<int> pageList, double hDPI, double vDPI, int rotate, int paperWidth, int paperHeight, int marginRight, int marginBottom, int marginLeft, int marginTop, bool strictMargins);
/**
Sets the paper color
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment