Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
Merge pull request #37 from jacobmarble/cups-media
Browse files Browse the repository at this point in the history
Fix CUPS print failure when job ticket VendorID blank.
  • Loading branch information
alekseyshl committed Jul 30, 2015
2 parents 293dd67 + fd827fa commit 0390aea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cups/cups.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0390aea

Please sign in to comment.