diff --git a/harbour-seaprint.pro b/harbour-seaprint.pro index f663705..f9b45f9 100644 --- a/harbour-seaprint.pro +++ b/harbour-seaprint.pro @@ -91,6 +91,7 @@ HEADERS += \ ppm2pwg/pdf2printable.h \ ppm2pwg/baselinify.h \ ppm2pwg/madness.h \ + ppm2pwg/printparameters.h \ ppm2pwg/PwgPgHdr.h \ ppm2pwg/PwgPgHdr.codable \ ppm2pwg/UrfPgHdr.h \ diff --git a/ppm2pwg b/ppm2pwg index 4844ff3..7db7a12 160000 --- a/ppm2pwg +++ b/ppm2pwg @@ -1 +1 @@ -Subproject commit 4844ff3ce2b773ae43585039aae146b6d225e0a6 +Subproject commit 7db7a12a8dbf8659050601888a6a48a38404f543 diff --git a/src/harbour-seaprint.cpp b/src/harbour-seaprint.cpp index c593c62..6c0c4ef 100644 --- a/src/harbour-seaprint.cpp +++ b/src/harbour-seaprint.cpp @@ -10,6 +10,7 @@ Q_DECLARE_METATYPE(CURLcode) Q_DECLARE_METATYPE(Bytestream) +Q_DECLARE_METATYPE(PrintParameters) template static QObject* singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine) @@ -26,6 +27,7 @@ int main(int argc, char *argv[]) { qRegisterMetaType(); qRegisterMetaType(); + qRegisterMetaType(); // Turn on/off logging according to setting QLoggingCategory::defaultCategory()->setEnabled(QtMsgType::QtDebugMsg, Settings::instance()->debugLog()); diff --git a/src/ippprinter.cpp b/src/ippprinter.cpp index cd2b7ce..77dd51a 100644 --- a/src/ippprinter.cpp +++ b/src/ippprinter.cpp @@ -517,6 +517,7 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename) _progress = ""; emit progressChanged(); + PrintParameters Params; QFileInfo fileinfo(filename); if(!fileinfo.exists()) @@ -542,8 +543,8 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename) QString PaperSize = getAttrOrDefault(jobAttrs, "media").toString(); - QString documentFormat = getAttrOrDefault(jobAttrs, "document-format").toString(); - qDebug() << "target format:" << documentFormat; + QString targetFormat = getAttrOrDefault(jobAttrs, "document-format").toString(); + qDebug() << "target format:" << targetFormat; QMargins margins(getAttrOrDefault(jobAttrs, "media-left-margin", "media-col").toInt(), getAttrOrDefault(jobAttrs, "media-top-margin", "media-col").toInt(), @@ -551,7 +552,7 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename) getAttrOrDefault(jobAttrs, "media-bottom-margin", "media-col").toInt()); // Only keep margin setting for JPEG - but only attemt to remove it if media-col exists - if(!(mimeType == Mimer::JPEG && documentFormat == Mimer::JPEG) && jobAttrs.contains("media-col")) + if(!(mimeType == Mimer::JPEG && targetFormat == Mimer::JPEG) && jobAttrs.contains("media-col")) { QJsonObject MediaCol = jobAttrs["media-col"].toObject(); QJsonObject MediaColValue = MediaCol["value"].toObject(); @@ -603,18 +604,45 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename) } // document-format goes in the op-attrs and not the job-attrs - o.insert("document-format", QJsonObject {{"tag", IppMsg::MimeMediaType}, {"value", documentFormat}}); + o.insert("document-format", QJsonObject {{"tag", IppMsg::MimeMediaType}, {"value", targetFormat}}); jobAttrs.remove("document-format"); - documentFormat = targetFormatIfAuto(documentFormat, mimeType, supportedMimeTypes); - qDebug() << "adjusted target format:" << documentFormat; + targetFormat = targetFormatIfAuto(targetFormat, mimeType, supportedMimeTypes); + qDebug() << "adjusted target format:" << targetFormat; - if(documentFormat == "" || documentFormat == Mimer::OctetStream) + if(targetFormat == "" || targetFormat == Mimer::OctetStream) { emit convertFailed(tr("Unknown document format")); return; } + if(targetFormat == Mimer::PDF) + { + Params.format = PrintParameters::PDF; + } + else if(targetFormat == Mimer::Postscript) + { + Params.format = PrintParameters::Postscript; + } + else if(targetFormat == Mimer::PWG) + { + Params.format = PrintParameters::PWG; + } + else if(targetFormat == Mimer::URF) + { + Params.format = PrintParameters::URF; + } + + if(!PaperSizes.contains(Params.paperSizeName.c_str())) + { + qDebug() << "Unsupported paper size" << Params.paperSizeName.c_str(); + emit convertFailed(tr("Unsupported paper size")); + } + QSizeF size = PaperSizes[Params.paperSizeName.c_str()]; + Params.paperSizeUnits = PrintParameters::Millimeters; + Params.paperSizeW = size.width(); + Params.paperSizeH = size.height(); + qDebug() << "Printing job" << o << jobAttrs; QJsonValue PrinterResolutionRef = getAttrOrDefault(jobAttrs, "printer-resolution"); @@ -623,22 +651,20 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename) bool BackHFlip = false; bool BackVFlip = false; - adjustRasterSettings(documentFormat, jobAttrs, HwResX, HwResY, BackHFlip, BackVFlip); + adjustRasterSettings(targetFormat, jobAttrs, HwResX, HwResY, BackHFlip, BackVFlip); - quint32 Quality = getAttrOrDefault(jobAttrs, "print-quality").toInt(); + Params.quality = getAttrOrDefault(jobAttrs, "print-quality").toInt(); QString PrintColorMode = getAttrOrDefault(jobAttrs, "print-color-mode").toString(); - quint32 Colors = PrintColorMode.contains("color") ? 3 : PrintColorMode.contains("monochrome") ? 1 : 0; + Params.colors = PrintColorMode.contains("color") ? 3 : PrintColorMode.contains("monochrome") ? 1 : Params.colors; - quint32 PageRangeLow = 0; - quint32 PageRangeHigh = 0; if(jobAttrs.contains("page-ranges")) { QJsonObject PageRanges = getAttrOrDefault(jobAttrs, "page-ranges").toObject(); - PageRangeLow = PageRanges["low"].toInt(); - PageRangeHigh = PageRanges["high"].toInt(); + Params.fromPage = PageRanges["low"].toInt(); + Params.toPage = PageRanges["high"].toInt(); // Effected locally, unless it is Postscript which we cant't render - if(documentFormat != Mimer::Postscript) + if(targetFormat != Mimer::Postscript) { jobAttrs.remove("page-ranges"); } @@ -652,11 +678,11 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename) setBusyMessage(tr("Preparing")); - if((mimeType == documentFormat) && (documentFormat == Mimer::Postscript)) + if((mimeType == targetFormat) && (targetFormat == Mimer::Postscript)) { // Can't process Postscript emit doJustUpload(filename, contents); } - else if((mimeType == documentFormat) && (documentFormat == Mimer::JPEG)) + else if((mimeType == targetFormat) && (targetFormat == Mimer::JPEG)) { // Just make the jpeg baseline-encoded, don't resize locally emit doFixupJpeg(filename, contents); } @@ -672,41 +698,33 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename) return; } - bool TwoSided = false; - bool Tumble = false; QString Sides = getAttrOrDefault(jobAttrs, "sides").toString(); if(Sides=="two-sided-long-edge") { - TwoSided = true; + Params.duplex = true; } else if(Sides=="two-sided-short-edge") { - TwoSided = true; - Tumble = true; + Params.duplex = true; + Params.tumble = true; } if(mimeType == Mimer::PDF) { - emit doConvertPdf(filename, contents, documentFormat, Colors, Quality, - PaperSize, HwResX, HwResY, TwoSided, Tumble, PageRangeLow, PageRangeHigh, - BackHFlip, BackVFlip); + emit doConvertPdf(filename, contents, Params); } else if(mimeType == Mimer::Plaintext) { - emit doConvertPlaintext(filename, contents, documentFormat, Colors, Quality, - PaperSize, HwResX, HwResY, TwoSided, Tumble, BackHFlip, BackVFlip); + emit doConvertPlaintext(filename, contents, Params); } else if (Mimer::isImage(mimeType)) { - emit doConvertImage(filename, contents, documentFormat, Colors, Quality, - PaperSize, HwResX, HwResY, margins); + emit doConvertImage(filename, contents, Params, targetFormat, margins); } else if(Mimer::isOffice(mimeType)) { - emit doConvertOfficeDocument(filename, contents, documentFormat, Colors, Quality, - PaperSize, HwResX, HwResY, TwoSided, Tumble, PageRangeLow, PageRangeHigh, - BackHFlip, BackVFlip); + emit doConvertOfficeDocument(filename, contents, Params); } else { diff --git a/src/ippprinter.h b/src/ippprinter.h index 5660b58..ad3b3ab 100644 --- a/src/ippprinter.h +++ b/src/ippprinter.h @@ -61,23 +61,13 @@ signals: void doJustUpload(QString filename, Bytestream header); void doFixupJpeg(QString filename, Bytestream header); - void doConvertPdf(QString filename, Bytestream header, - QString targetFormat, quint32 Colors, quint32 Quality, QString PaperSize, - quint32 HwResX, quint32 HwResY, bool TwoSided, bool Tumble, - quint32 PageRangeLow, quint32 PageRangeHigh, bool BackHFlip, bool BackVFlip); + void doConvertPdf(QString filename, Bytestream header, PrintParameters Params); - void doConvertImage(QString filename, Bytestream header, - QString targetFormat, quint32 Colors, quint32 Quality, QString PaperSize, - quint32 HwResX, quint32 HwResY, QMargins margins); + void doConvertImage(QString filename, Bytestream header, PrintParameters Params, QString targetFormat, QMargins margins); - void doConvertOfficeDocument(QString filename, Bytestream header, - QString targetFormat, quint32 Colors, quint32 Quality, QString PaperSize, - quint32 HwResX, quint32 HwResY, bool TwoSided, bool Tumble, - quint32 PageRangeLow, quint32 PageRangeHigh, bool BackHFlip, bool BackVFlip); + void doConvertOfficeDocument(QString filename, Bytestream header, PrintParameters Params); - void doConvertPlaintext(QString filename, Bytestream header, - QString targetFormat, quint32 Colors, quint32 Quality, QString PaperSize, - quint32 HwResX, quint32 HwResY, bool TwoSided, bool Tumble, bool BackHFlip, bool BackVFlip); + void doConvertPlaintext(QString filename, Bytestream header, PrintParameters Params); void doGetStrings(QUrl url); void doGetImage(QUrl url); diff --git a/src/printerworker.cpp b/src/printerworker.cpp index 10b7fa4..21931c6 100644 --- a/src/printerworker.cpp +++ b/src/printerworker.cpp @@ -101,42 +101,9 @@ catch(const ConvertFailedException& e) } } -void PrinterWorker::convertPdf(QString filename, Bytestream header, - QString targetFormat, quint32 Colors, quint32 Quality, QString PaperSize, - quint32 HwResX, quint32 HwResY, bool TwoSided, bool Tumble, - quint32 PageRangeLow, quint32 PageRangeHigh, bool BackHFlip, bool BackVFlip) +void PrinterWorker::convertPdf(QString filename, Bytestream header, PrintParameters Params) { try { - Format format; - - emit busyMessage(tr("Printing")); - - if(targetFormat == Mimer::URF) - { - format = Format::URF; - } - else if(targetFormat == Mimer::PWG) - { - format = Format::PWG; - } - else if(targetFormat == Mimer::Postscript) - { - format = Format::Postscript; - } - else if (targetFormat == Mimer::PDF) - { - format = Format::PDF; - } - else - { - throw ConvertFailedException(tr("Unsupported target format")); - } - - if(Colors == 0) - { - Colors = 3; - } - CurlRequester cr(_printer->httpUrl()); connect(&cr, &CurlRequester::done, _printer, &IppPrinter::printRequestFinished); @@ -154,19 +121,9 @@ try { emit progress(page, total); }); - if(!PaperSizes.contains(PaperSize)) - { - qDebug() << "Unsupported paper size" << PaperSize; - throw ConvertFailedException(tr("Unsupported paper size")); - } - QSizeF size = PaperSizes[PaperSize]; - float Width = size.width(); - float Height = size.height(); - bool verbose = QLoggingCategory::defaultCategory()->isDebugEnabled(); - int res = pdf_to_printable(filename.toStdString(), WriteFun, Colors, Quality, PaperSize.toStdString(), Width, Height, HwResX, HwResY, - format, TwoSided, Tumble, BackHFlip, BackVFlip, PageRangeLow, PageRangeHigh, ProgressFun, verbose); + int res = pdf_to_printable(filename.toStdString(), WriteFun, Params, ProgressFun, verbose); if(res != 0) { @@ -181,60 +138,25 @@ catch(const ConvertFailedException& e) } } -void PrinterWorker::convertImage(QString filename, Bytestream header, - QString targetFormat, quint32 Colors, quint32 Quality, QString PaperSize, - quint32 HwResX, quint32 HwResY, QMargins margins) +void PrinterWorker::convertImage(QString filename, Bytestream header, PrintParameters Params, QString targetFormat, QMargins margins) { try { - bool urf = false; - bool pdfOrPostscript = false; QString imageFormat = ""; QStringList supportedImageFormats = {Mimer::JPEG, Mimer::PNG}; - if(targetFormat == Mimer::URF) - { - urf = true; - } - else if(targetFormat == Mimer::PWG) - { - //ok - } - else if(targetFormat == Mimer::PDF || targetFormat == Mimer::Postscript) - { - HwResX = HwResY = std::min(HwResX, HwResY); - pdfOrPostscript = true; - } - else if(supportedImageFormats.contains(targetFormat)) + if(supportedImageFormats.contains(targetFormat)) { imageFormat = targetFormat.split("/")[1]; } - else - { - throw ConvertFailedException(tr("Unsupported target format")); - } - if(Colors == 0) - { - Colors = 3; - } - - if(urf && (HwResX != HwResY)) + if(Params.format == PrintParameters::URF && (Params.hwResW != Params.hwResH)) { // URF only supports symmetric resolutions - qDebug() << "Unsupported URF resolution" << PaperSize; + qDebug() << "Unsupported URF resolution"; throw ConvertFailedException(tr("Unsupported resolution (dpi)")); } - if(!PaperSizes.contains(PaperSize)) - { - qDebug() << "Unsupported paper size" << PaperSize; - throw ConvertFailedException(tr("Unsupported paper size")); - } - QSizeF size = PaperSizes[PaperSize]; - quint32 Width = qRound(size.width()/25.4*HwResX); - quint32 Height = qRound(size.height()/25.4*HwResY); - - qDebug() << "Size is" << Width << "x" << Height; + qDebug() << "Size is" << Params.getPaperSizeWInPixels() << "x" << Params.getPaperSizeHInPixels(); QImage inImage; if(!inImage.load(filename)) @@ -248,39 +170,38 @@ try { inImage = inImage.transformed(QMatrix().rotate(270.0)); } - int leftMarginPx = (margins.left()/2540.0)*HwResX; - int rightMarginPx = (margins.right()/2540.0)*HwResX; - int topMarginPx = (margins.top()/2540.0)*HwResY; - int bottomMarginPx = (margins.bottom()/2540.0)*HwResY; + int leftMarginPx = (margins.left()/2540.0)*Params.hwResW; + int rightMarginPx = (margins.right()/2540.0)*Params.hwResW; + int topMarginPx = (margins.top()/2540.0)*Params.hwResH; + int bottomMarginPx = (margins.bottom()/2540.0)*Params.hwResH; int totalXMarginPx = leftMarginPx+rightMarginPx; int totalYMarginPx = topMarginPx+bottomMarginPx; - inImage = inImage.scaled(Width-totalXMarginPx, Height-totalYMarginPx, + inImage = inImage.scaled(Params.getPaperSizeWInPixels()-totalXMarginPx, Params.getPaperSizeHInPixels()-totalYMarginPx, Qt::KeepAspectRatio, Qt::SmoothTransformation); - if(pdfOrPostscript) + if(imageFormat == "" && (Params.format == PrintParameters::PDF || Params.format == PrintParameters::Postscript)) { QTemporaryFile tmpPdfFile; tmpPdfFile.open(); QPdfWriter pdfWriter(tmpPdfFile.fileName()); pdfWriter.setCreator("SeaPrint " SEAPRINT_VERSION); - QPageSize pageSize(size, QPageSize::Millimeter); + QPageSize pageSize({Params.getPaperSizeWInPoints(), Params.getPaperSizeHInPoints()}, QPageSize::Point); pdfWriter.setPageSize(pageSize); - pdfWriter.setResolution(HwResX); + pdfWriter.setResolution(Params.hwResH); QPainter painter(&pdfWriter); int xOffset = ((pdfWriter.width()-totalXMarginPx)-inImage.width())/2 + leftMarginPx; int yOffset = ((pdfWriter.height()-totalYMarginPx)-inImage.height())/2 + topMarginPx; painter.drawImage(xOffset, yOffset, inImage); painter.end(); - convertPdf(tmpPdfFile.fileName(), header, targetFormat, Colors, Quality, PaperSize, - HwResX, HwResY, false, false, 0, 0, false, false); + convertPdf(tmpPdfFile.fileName(), header, Params); } else { - QImage outImage = QImage(Width, Height, inImage.format()); + QImage outImage = QImage(Params.getPaperSizeWInPixels(), Params.getPaperSizeHInPixels(), inImage.format()); outImage.fill(Qt::white); QPainter painter(&outImage); int xOffset = ((outImage.width()-totalXMarginPx)-inImage.width())/2 + leftMarginPx; @@ -302,16 +223,19 @@ try { else { // We are converting to a raster format - bool gray = Colors == 0 ? inImage.allGray() : Colors == 1; + if(inImage.allGray()) + { + Params.colors = 1; // No need to waste space/bandwidth... + } - outImage.save(&buf, gray ? "pgm" : "ppm"); + outImage.save(&buf, Params.colors==1 ? "pgm" : "ppm"); buf.seek(0); // Skip header - TODO consider reimplementing buf.readLine(255); buf.readLine(255); buf.readLine(255); - Bytestream inBts(Width*Height*Colors); + Bytestream inBts(Params.getPaperSizeWInPixels() * Params.getPaperSizeHInPixels() * Params.colors); if((((size_t)buf.size())-buf.pos()) != inBts.size()) { @@ -321,11 +245,11 @@ try { buf.read((char*)(inBts.raw()), inBts.size()); - outBts << (urf ? make_urf_file_hdr(1) : make_pwg_file_hdr()); + outBts << (Params.format == PrintParameters::URF ? make_urf_file_hdr(1) : make_pwg_file_hdr()); bool verbose = QLoggingCategory::defaultCategory()->isDebugEnabled(); - bmp_to_pwg(inBts, outBts, urf, 1, Colors, Quality, HwResX, HwResY, Width, Height, false, false, PaperSize.toStdString(), false, false, verbose); + bmp_to_pwg(inBts, outBts, 1, Params, verbose); } CurlRequester cr(_printer->httpUrl()); @@ -346,27 +270,24 @@ catch(const ConvertFailedException& e) } } -void PrinterWorker::convertOfficeDocument(QString filename, Bytestream header, - QString targetFormat, quint32 Colors, quint32 Quality, QString PaperSize, - quint32 HwResX, quint32 HwResY, bool TwoSided, bool Tumble, - quint32 PageRangeLow, quint32 PageRangeHigh, bool BackHFlip, bool BackVFlip) +void PrinterWorker::convertOfficeDocument(QString filename, Bytestream header, PrintParameters Params) { try { - if(targetFormat == Mimer::URF && (HwResX != HwResY)) + if(Params.format == PrintParameters::URF && (Params.hwResW != Params.hwResH)) { // URF only supports symmetric resolutions - qDebug() << "Unsupported URF resolution" << PaperSize; + qDebug() << "Unsupported URF resolution"; throw ConvertFailedException(tr("Unsupported resolution (dpi)")); } QString ShortPaperSize; - if(CalligraPaperSizes.contains(PaperSize)) + if(CalligraPaperSizes.contains(Params.paperSizeName.c_str())) { - ShortPaperSize = CalligraPaperSizes[PaperSize]; + ShortPaperSize = CalligraPaperSizes[Params.paperSizeName.c_str()]; } else { - qDebug() << "Unsupported PDF paper size" << PaperSize; + qDebug() << "Unsupported PDF paper size" << Params.paperSizeName.c_str(); throw ConvertFailedException(tr("Unsupported PDF paper size")); } @@ -403,30 +324,7 @@ try { // qDebug() << CalligraConverter->readAllStandardError(); - quint32 pages = ConvertChecker::instance()->pdfPages(tmpPdfFile.fileName()); - if (!pages) - { - qDebug() << "pdfinfo returned 0 pages"; - throw ConvertFailedException(tr("Failed to get info about PDF file")); - } - - if(PageRangeLow==0) - { - PageRangeLow=1; - } - - if(PageRangeHigh==0 || PageRangeHigh > pages) - { - PageRangeHigh=pages; - } - - // Actual number of pages to print - pages = PageRangeHigh-PageRangeLow+1; - - qDebug() << "PageRangeLow" << PageRangeLow << "PageRangeHigh" << PageRangeHigh << "pages" << pages; - - convertPdf(tmpPdfFile.fileName(), header, targetFormat, Colors, Quality, PaperSize, HwResX, HwResY, TwoSided, Tumble, - PageRangeLow, PageRangeHigh, BackHFlip, BackVFlip); + convertPdf(tmpPdfFile.fileName(), header, Params); qDebug() << "posted"; @@ -437,19 +335,16 @@ catch(const ConvertFailedException& e) } } -void PrinterWorker::convertPlaintext(QString filename, Bytestream header, - QString targetFormat, quint32 Colors, quint32 Quality, QString PaperSize, - quint32 HwResX, quint32 HwResY, bool TwoSided, bool Tumble, - bool BackHFlip, bool BackVFlip) +void PrinterWorker::convertPlaintext(QString filename, Bytestream header, PrintParameters Params) { try { - if(!PaperSizes.contains(PaperSize)) + if(!PaperSizes.contains(Params.paperSizeName.c_str())) { - qDebug() << "Unsupported paper size" << PaperSize; + qDebug() << "Unsupported paper size" << Params.paperSizeName.c_str(); throw ConvertFailedException(tr("Unsupported paper size")); } - QSizeF size = PaperSizes[PaperSize]; + QSizeF size = PaperSizes[Params.paperSizeName.c_str()]; QFile inFile(filename); if(!inFile.open(QIODevice::ReadOnly)) @@ -457,7 +352,7 @@ try { throw ConvertFailedException(tr("Failed to open file")); } - quint32 resolution = std::min(HwResX, HwResY); + quint32 resolution = std::min(Params.hwResW, Params.hwResH); QTemporaryFile tmpPdfFile; tmpPdfFile.open(); @@ -578,8 +473,7 @@ try { painter.end(); - convertPdf(tmpPdfFile.fileName(), header, targetFormat, Colors, Quality, PaperSize, HwResX, HwResY, - TwoSided, Tumble, 0, 0, BackHFlip, BackVFlip); + convertPdf(tmpPdfFile.fileName(), header, Params); qDebug() << "Finished"; qDebug() << "posted"; diff --git a/src/printerworker.h b/src/printerworker.h index cdb7d19..9923465 100644 --- a/src/printerworker.h +++ b/src/printerworker.h @@ -2,6 +2,7 @@ #define PRINTERWORKER_H #include #include "curlrequester.h" +#include "ppm2pwg/printparameters.h" class IppPrinter; @@ -40,23 +41,13 @@ public slots: void fixupJpeg(QString filename, Bytestream header); - void convertPdf(QString filename, Bytestream header, - QString targetFormat, quint32 Colors, quint32 Quality, QString PaperSize, - quint32 HwResX, quint32 HwResY, bool TwoSided, bool Tumble, - quint32 PageRangeLow, quint32 PageRangeHigh, bool BackHFlip, bool BackVFlip); + void convertPdf(QString filename, Bytestream header, PrintParameters Params); - void convertImage(QString filename, Bytestream header, - QString targetFormat, quint32 Colors, quint32 Quality, QString PaperSize, - quint32 HwResX, quint32 HwResY, QMargins margins); + void convertImage(QString filename, Bytestream header, PrintParameters Params, QString targetFormat, QMargins margins); - void convertOfficeDocument(QString filename, Bytestream header, - QString targetFormat, quint32 Colors, quint32 Quality, QString PaperSize, - quint32 HwResX, quint32 HwResY, bool TwoSided, bool Tumble, - quint32 PageRangeLow, quint32 PageRangeHigh, bool BackHFlip, bool BackVFlip); + void convertOfficeDocument(QString filename, Bytestream header, PrintParameters Params); - void convertPlaintext(QString filename, Bytestream header, - QString targetFormat, quint32 Colors, quint32 Quality, QString PaperSize, - quint32 HwResX, quint32 HwResY, bool TwoSided, bool Tumble, bool BackHFlip, bool BackVFlip); + void convertPlaintext(QString filename, Bytestream header, PrintParameters Params); signals: void progress(qint64 done, qint64 pages); diff --git a/translations/harbour-seaprint-de.ts b/translations/harbour-seaprint-de.ts index 54d7385..05adf82 100644 --- a/translations/harbour-seaprint-de.ts +++ b/translations/harbour-seaprint-de.ts @@ -307,6 +307,10 @@ Preparing Vorbereiten + + Unsupported paper size + Nicht unterstütztes Papierformat + JobsPage @@ -500,14 +504,6 @@ auf diesem Drucker Unsupported resolution (dpi) Nicht unterstützte Auflösung (dpi) - - Unsupported target format - Nicht unterstützes Zielformat - - - Failed to get info about PDF file - Informationen über die PDF-Datei können nicht abgerufen werden - Failed to open file Öffnen der Datei fehlgeschlagen diff --git a/translations/harbour-seaprint-es.ts b/translations/harbour-seaprint-es.ts index 1221344..6eca43c 100644 --- a/translations/harbour-seaprint-es.ts +++ b/translations/harbour-seaprint-es.ts @@ -307,6 +307,10 @@ Preparing Preparando + + Unsupported paper size + Tamaño de papel no soportado + JobsPage @@ -499,14 +503,6 @@ Unsupported resolution (dpi) Resolución (ppp) no soportada - - Unsupported target format - Formato de destino no soportado - - - Failed to get info about PDF file - Error al obtener info de archivo PDF - Failed to open file Error al abrir archivo diff --git a/translations/harbour-seaprint-fr.ts b/translations/harbour-seaprint-fr.ts index dbf2445..562ae5e 100644 --- a/translations/harbour-seaprint-fr.ts +++ b/translations/harbour-seaprint-fr.ts @@ -307,6 +307,10 @@ Preparing En cours de préparation + + Unsupported paper size + Taille de papier non prise en charge + JobsPage @@ -500,14 +504,6 @@ sur cette imprimante Unsupported resolution (dpi) Résolution (dpi) non prise en charge - - Unsupported target format - Format cible non pris en charge - - - Failed to get info about PDF file - Échec de l'obtention d'informations du fichier PDF - Failed to open file Échec de l'ouverture du fichier diff --git a/translations/harbour-seaprint-nl.ts b/translations/harbour-seaprint-nl.ts index ce686b7..9106d60 100644 --- a/translations/harbour-seaprint-nl.ts +++ b/translations/harbour-seaprint-nl.ts @@ -307,6 +307,10 @@ Preparing Voorbereiden + + Unsupported paper size + Niet-ondersteund papierformaat + JobsPage @@ -499,14 +503,6 @@ Unsupported resolution (dpi) Niet-ondersteunde resolutie (dpi) - - Unsupported target format - Niet-ondersteund doelformaat - - - Failed to get info about PDF file - Informatie over het PDF-bestand ophalen mislukt - Failed to open file Bestand openen mislukt diff --git a/translations/harbour-seaprint-pl.ts b/translations/harbour-seaprint-pl.ts index 30a711e..fa9e372 100644 --- a/translations/harbour-seaprint-pl.ts +++ b/translations/harbour-seaprint-pl.ts @@ -307,6 +307,10 @@ Preparing + + Unsupported paper size + + JobsPage @@ -479,14 +483,6 @@ PrinterWorker - - Failed to get info about PDF file - - - - Unsupported target format - - Unsupported resolution (dpi) diff --git a/translations/harbour-seaprint-zh_CN.ts b/translations/harbour-seaprint-zh_CN.ts index f2db9d8..de911e9 100644 --- a/translations/harbour-seaprint-zh_CN.ts +++ b/translations/harbour-seaprint-zh_CN.ts @@ -307,6 +307,10 @@ Preparing + + Unsupported paper size + 纸张大小不受支持 + JobsPage @@ -499,14 +503,6 @@ Unsupported resolution (dpi) 分辨率不受支持(dpi) - - Unsupported target format - 目标格式不受支持 - - - Failed to get info about PDF file - 获取PDF文件信息错误 - Failed to open file 打开文件失败