Commit 0390aea1 authored by alekseyshl's avatar alekseyshl

Merge pull request #37 from jacobmarble/cups-media

Fix CUPS print failure when job ticket VendorID blank.
parents 293dd67c fd827faf
......@@ -395,7 +395,13 @@ func ticketToOptions(ticket cdd.CloudJobTicket) map[string]string {
}
}
if ticket.Print.MediaSize != nil {
m["media"] = ticket.Print.MediaSize.VendorID
if ticket.Print.MediaSize.VendorID != "" {
m["media"] = ticket.Print.MediaSize.VendorID
} else {
widthPoints := micronsToPoints(ticket.Print.MediaSize.WidthMicrons)
heightPoints := micronsToPoints(ticket.Print.MediaSize.HeightMicrons)
m["media"] = fmt.Sprintf("Custom.%sx%s", widthPoints, heightPoints)
}
}
if ticket.Print.Collate != nil {
if ticket.Print.Collate.Collate {
......
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