Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
cd93ab9e
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cd93ab9e
编写于
4月 10, 2008
作者:
J
jgodinez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6678161: Printing to remote non-Postscript printer does not work in Linux
Reviewed-by: prr, tdv
上级
e7d97dea
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
72 addition
and
27 deletion
+72
-27
src/solaris/classes/sun/print/CUPSPrinter.java
src/solaris/classes/sun/print/CUPSPrinter.java
+2
-2
src/solaris/classes/sun/print/IPPPrintService.java
src/solaris/classes/sun/print/IPPPrintService.java
+52
-11
src/solaris/classes/sun/print/UnixPrintServiceLookup.java
src/solaris/classes/sun/print/UnixPrintServiceLookup.java
+18
-14
未找到文件。
src/solaris/classes/sun/print/CUPSPrinter.java
浏览文件 @
cd93ab9e
...
...
@@ -333,7 +333,7 @@ public class CUPSPrinter {
AttributeClass
.
ATTRIBUTES_NATURAL_LANGUAGE
,
new
AttributeClass
(
"requested-attributes"
,
AttributeClass
.
TAG_KEYWORD
,
"printer-
name
"
)
"printer-
uri-supported
"
)
};
if
(
IPPPrintService
.
writeIPPRequest
(
os
,
...
...
@@ -354,7 +354,7 @@ public class CUPSPrinter {
ArrayList
printerNames
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
responseMap
.
length
;
i
++)
{
AttributeClass
attribClass
=
(
AttributeClass
)
responseMap
[
i
].
get
(
"printer-
name
"
);
responseMap
[
i
].
get
(
"printer-
uri-supported
"
);
if
(
attribClass
!=
null
)
{
String
nameStr
=
attribClass
.
getStringValue
();
...
...
src/solaris/classes/sun/print/IPPPrintService.java
浏览文件 @
cd93ab9e
...
...
@@ -335,6 +335,38 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
}
IPPPrintService
(
String
name
,
String
uriStr
,
boolean
isCups
)
{
if
((
name
==
null
)
||
(
uriStr
==
null
)){
throw
new
IllegalArgumentException
(
"null uri or printer name"
);
}
printer
=
name
;
supportedDocFlavors
=
null
;
supportedCats
=
null
;
mediaSizeNames
=
null
;
customMediaSizeNames
=
null
;
mediaTrays
=
null
;
cps
=
null
;
init
=
false
;
defaultMediaIndex
=
-
1
;
try
{
myURL
=
new
URL
(
uriStr
.
replaceFirst
(
"ipp"
,
"http"
));
}
catch
(
Exception
e
)
{
IPPPrintService
.
debug_println
(
debugPrefix
+
" IPPPrintService, myURL="
+
myURL
+
" Exception= "
+
e
);
}
isCupsPrinter
=
isCups
;
try
{
myURI
=
new
URI
(
uriStr
);
debug_println
(
debugPrefix
+
"IPPPrintService myURI : "
+
myURI
);
}
catch
(
java
.
net
.
URISyntaxException
e
)
{
throw
new
IllegalArgumentException
(
"invalid uri"
);
}
}
/*
* Initialize mediaSizeNames, mediaTrays and other attributes.
...
...
@@ -375,7 +407,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
return
;
}
catch
(
Exception
e
)
{
IPPPrintService
.
debug_println
(
debugPrefix
+
" error creating CUPSPrinter
"
);
" error creating CUPSPrinter
e="
+
e
);
}
}
...
...
@@ -807,6 +839,18 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
docList
.
addAll
(
Arrays
.
asList
(
flavors
));
if
(
isCupsPrinter
)
{
/*
Always add Pageable and Printable for CUPS
since it uses Filters to convert from Postscript
to device printer language.
*/
docList
.
add
(
DocFlavor
.
SERVICE_FORMATTED
.
PAGEABLE
);
docList
.
add
(
DocFlavor
.
SERVICE_FORMATTED
.
PRINTABLE
);
}
if
(
mimeType
.
equals
(
"text/plain"
)
&&
addHostEncoding
)
{
docList
.
add
(
Arrays
.
asList
(
textPlainHost
));
...
...
@@ -820,11 +864,6 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
}
else
if
(
mimeType
.
equals
(
"image/jpeg"
))
{
jpgImagesAdded
=
true
;
}
else
if
(
mimeType
.
indexOf
(
"postscript"
)
!=
-
1
)
{
docList
.
add
(
DocFlavor
.
SERVICE_FORMATTED
.
PAGEABLE
);
docList
.
add
(
DocFlavor
.
SERVICE_FORMATTED
.
PRINTABLE
);
psSupported
=
true
;
}
break
;
...
...
@@ -841,7 +880,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
}
// check if we need to add image DocFlavors
if
(
psSupported
)
{
if
(
psSupported
||
isCupsPrinter
)
{
if
(!
jpgImagesAdded
)
{
docList
.
addAll
(
Arrays
.
asList
(
imageJPG
));
}
...
...
@@ -1540,10 +1579,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
if
(
isCupsPrinter
)
{
try
{
urlConnection
=
getIPPConnection
(
new
URL
(
"http://"
+
CUPSPrinter
.
getServer
()+
":"
+
CUPSPrinter
.
getPort
()+
"/printers/"
+
printer
+
".ppd"
));
new
URL
(
myURL
+
".ppd"
));
InputStream
is
=
urlConnection
.
getInputStream
();
if
(
is
!=
null
)
{
...
...
@@ -1559,6 +1595,11 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
}
}
}
catch
(
java
.
io
.
IOException
e
)
{
debug_println
(
" isPostscript, e= "
+
e
);
/* if PPD is not found, this may be a raw printer
and in this case it is assumed that it is a
Postscript printer */
// do nothing
}
}
}
...
...
src/solaris/classes/sun/print/UnixPrintServiceLookup.java
浏览文件 @
cd93ab9e
...
...
@@ -196,11 +196,20 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
// refreshes "printServices"
public
synchronized
void
refreshServices
()
{
String
[]
printers
;
/* excludes the default printer */
/* excludes the default printer */
String
[]
printers
=
null
;
// array of printer names
String
[]
printerURIs
=
null
;
//array of printer URIs
getDefaultPrintService
();
if
(
CUPSPrinter
.
isCupsRunning
())
{
printers
=
CUPSPrinter
.
getAllPrinters
();
printerURIs
=
CUPSPrinter
.
getAllPrinters
();
if
((
printerURIs
!=
null
)
&&
(
printerURIs
.
length
>
0
))
{
printers
=
new
String
[
printerURIs
.
length
];
for
(
int
i
=
0
;
i
<
printerURIs
.
length
;
i
++)
{
int
lastIndex
=
printerURIs
[
i
].
lastIndexOf
(
"/"
);
printers
[
i
]
=
printerURIs
[
i
].
substring
(
lastIndex
+
1
);
}
}
}
else
{
if
(
isSysV
())
{
printers
=
getAllPrinterNamesSysV
();
...
...
@@ -236,12 +245,9 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
if
(
CUPSPrinter
.
isCupsRunning
())
{
try
{
URL
serviceURL
=
new
URL
(
"http://"
+
CUPSPrinter
.
getServer
()+
":"
+
CUPSPrinter
.
getPort
()+
"/"
+
printers
[
p
]);
printerList
.
add
(
new
IPPPrintService
(
printers
[
p
],
serviceURL
));
printerList
.
add
(
new
IPPPrintService
(
printers
[
p
],
printerURIs
[
p
],
true
));
}
catch
(
Exception
e
)
{
IPPPrintService
.
debug_println
(
debugPrefix
+
" getAllPrinters Exception "
+
...
...
@@ -265,12 +271,10 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
if
(
j
==
printServices
.
length
)
{
// not found?
if
(
CUPSPrinter
.
isCupsRunning
())
{
try
{
URL
serviceURL
=
new
URL
(
"http://"
+
CUPSPrinter
.
getServer
()+
":"
+
CUPSPrinter
.
getPort
()+
"/"
+
printers
[
p
]);
printerList
.
add
(
new
IPPPrintService
(
printers
[
p
],
serviceURL
));
printerList
.
add
(
new
IPPPrintService
(
printers
[
p
],
printerURIs
[
p
],
true
));
}
catch
(
Exception
e
)
{
IPPPrintService
.
debug_println
(
debugPrefix
+
" getAllPrinters Exception "
+
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录