我尝试编写的程序只使用Google云打印打印文档的第一页。除了page_range之外,我已经获得了所有参数,并且无法解读开发者指南。有人能够告诉我我用于page_range的格式有什么问题吗?我正在使用JavaScript列表
var ticket = {
version: "1.0",
print: {
color: {
type: "STANDARD_COLOR",
vendor_id: "Color"
},
duplex: {
type: "NO_DUPLEX"
},
copies: {copies: 1},
media_size: {
width_microns: 27940,
height_microns:60960
},
page_orientation: {
type: "LANDSCAPE"
},
margins: {
top_microns:0,
bottom_microns:0,
left_microns:0,
right_microns:0
},
page_range: {
interval: {
start:1,
end:1
}
}
}
};
答案 0 :(得分:1)
page_range
包含名为rake db:migrate
的重复字段。它被重复,以便您可以请求多个范围:
interval
PageRange.Interval
看起来像这样:
// Ticket item indicating what pages to use.
message PageRangeTicketItem {
repeated PageRange.Interval interval = 1;
}
因此,请尝试打印第1页和第6-7页:
// Interval of pages in the document to print.
message Interval {
// Beginning of the interval (inclusive) (required).
optional int32 start = 1;
// End of the interval (inclusive). If not set, then the interval will
// include all available pages after start.
optional int32 end = 2;
}
答案 1 :(得分:1)
我建议你这样使用
page_range: {
interval:
[
{
start: 1,
end: 7
}
]
}