Improve format logic
This commit is contained in:
parent
fe8dfe4d1e
commit
a28d5a5d83
1 changed files with 8 additions and 5 deletions
|
@ -6,12 +6,12 @@ function supported_formats(printer, ConvertChecker, considerAdditionalFormats)
|
||||||
formats=formats+printer.additionalDocumentFormats;
|
formats=formats+printer.additionalDocumentFormats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var raster = (has(formats, "image/pwg-raster") || has(formats, "image/urf"));
|
||||||
|
|
||||||
var mimetypes = [];
|
var mimetypes = [];
|
||||||
var supported = [];
|
var supported = [];
|
||||||
if(has(formats, "application/pdf") ||
|
if(has(formats, "application/pdf") ||
|
||||||
(ConvertChecker.pdf && ( has(formats, "application/postscript") ||
|
(ConvertChecker.pdf && ( has(formats, "application/postscript") || raster )))
|
||||||
has(formats, "image/pwg-raster") ||
|
|
||||||
has(formats, "image/urf"))) )
|
|
||||||
{
|
{
|
||||||
mimetypes.push("application/pdf");
|
mimetypes.push("application/pdf");
|
||||||
supported.push("PDF");
|
supported.push("PDF");
|
||||||
|
@ -22,10 +22,13 @@ function supported_formats(printer, ConvertChecker, considerAdditionalFormats)
|
||||||
supported.push("Postscript");
|
supported.push("Postscript");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( has(formats, "image/pwg-raster") || has(formats, "image/urf"))
|
if (raster || has(formats, "image/jpeg"))
|
||||||
{
|
{
|
||||||
mimetypes.push("image/jpeg");
|
mimetypes.push("image/jpeg");
|
||||||
supported.push("JPEG");
|
supported.push("JPEG");
|
||||||
|
}
|
||||||
|
if(raster || has(formats, "image/png"))
|
||||||
|
{
|
||||||
mimetypes.push("image/png");
|
mimetypes.push("image/png");
|
||||||
supported.push("PNG");
|
supported.push("PNG");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue