icepdf-bug-436 批改
发布时间:2011-06-20 20:20:58 文章来源:www.iduyao.cn 采编人员:星星草
icepdf-bug-436 修改
icepdf解析pdf文件空白bug修改。bug编号 pdf-436,修改人 wenwu
http://jira.icesoft.org/browse/PDF-436
问题修改如下:
Modify TilingPattern.java
1. public void init() {
if (inited) {
return;
}
//Modify bug by wuwen.55@gmail.com, see bug PDF-436
inited = true;
//Modify bug by wuwen.55@gmail.com end.
...
}
2. public void paintPattern(Graphics2D g, Page parentPage) {
if (patternPaint == null) {
AffineTransform matrixInv = getInvMatrix();
Rectangle2D bBoxMod = matrix.createTransformedShape(bBox).getBounds2D();
int width = (int) bBoxMod.getWidth();
int height = (int) bBoxMod.getHeight();
// corner cases where some bBoxes don't have a dimension.
if (width == 0) {
width = 1;
}
if (height == 0) {
height = 1;
}
// create the new image to write too.
final BufferedImage bi = new BufferedImage(width, height,
BufferedImage.TYPE_INT_ARGB);
Graphics2D canvas = bi.createGraphics();
// apply current hints
canvas.setRenderingHints(g.getRenderingHints());
// copy over the rendering hints
// get shapes and paint them.
Shapes tilingShapes = getShapes();
//Modify bug by wuwen.55@gmail.com, see bug PDF-436
// finally paint the graphic using the current gs.
patternPaint = new TexturePaint(bi, bBoxMod);
g.setPaint(patternPaint);
//Modify by wuwen.55@gmail.com end.
if (tilingShapes != null) {
// setup resource parent
tilingShapes.setPageParent(parentPage);
canvas.setClip(0, 0, width, height);
// apply the pattern space
canvas.setTransform(matrix);
// move it back by any shear/rotation distance.
canvas.translate(matrixInv.getTranslateX(),
matrixInv.getTranslateY());
if (paintType == TilingPattern.PAINTING_TYPE_UNCOLORED_TILING_PATTERN) {
canvas.setColor(unColored);
}
// paint the pattern content stream.
tilingShapes.paint(canvas);
// do a little tiling if there is a shear so that we
// don't end up with any white space around the rotate
// pattern cell. Java texture paint can't take a transform
// when painting so this will have to do.
if (matrix.getShearX() > 0 ||
matrix.getShearY() > 0) {
canvas.translate(bBox.getWidth(), 0);
tilingShapes.paint(canvas);
canvas.translate(0, -bBox.getHeight());
tilingShapes.paint(canvas);
canvas.translate(-bBox.getWidth(), 0);
tilingShapes.paint(canvas);
canvas.translate(-bBox.getWidth(), 0);
tilingShapes.paint(canvas);
canvas.translate(0, bBox.getHeight());
tilingShapes.paint(canvas);
canvas.translate(0, bBox.getHeight());
tilingShapes.paint(canvas);
canvas.translate(bBox.getWidth(), 0);
tilingShapes.paint(canvas);
canvas.translate(bBox.getWidth(), 0);
tilingShapes.paint(canvas);
}
// release the page parent
tilingShapes.setPageParent(null);
}
// show it in a frame
// final JFrame f = new JFrame("Test");
// f.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
// f.getContentPane().add(new JComponent() {
// @Override
// public void paint(Graphics g_) {
// super.paint(g_);
// g_.drawImage(bi, 0, 0, f);
// }
// });
// f.setSize(new Dimension(800, 800));
// f.setVisible(true);
// post paint cleanup
canvas.dispose();
bi.flush();
} else {
g.setPaint(patternPaint);
}
}
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
使用PD cdm 转 oom 的中文问题
我的cdm中的name是中文,code是英文
Ctrl + Shift + O 生成oom时,选的语言是Java
可是生成的类...
-
怎么用EA 或者powerDesigner 画功能框架图
RT, 操作了挺久的了,还是摸索出来。
知道用word 画可以,但觉得那样画太不方便 了。
框...
-
软件or硬件?
计算机硬件的发展前景如何,和软件相比如何?大学里应该如何学习这方面的知识?
------解决方案--------------------
只...
-
用powerdesigner怎么造数据?
我现在只会做到生成pdm,听说pd可以选数据的,但不知怎么用。
------解决方案--------------------
选中...
-
PowerDesigner如何禁用一个字段
在CDM里我新建了一个Entitiy,然后我给这个Entitiy中加上列,我想其中有些列生成数据库里的列,有些列...
-
绝顶郁闷,PD DBMS转换导致The preview is empty because of the setting
从MYSQL4的DBMS转换到MYSQL5,很多表都正常,唯独一张表的Pre...
-
如何让PowerDesigner支持自动生成含DB2的表和列注释的角本
我现在用的是IBM DB2 UDB 7.x Common Server
------解决方...
-
powerdesigner15不支持OOM??
powerdesigner15不支持OOM??
------解决方案--------------------
你破解的有问题,我的可以。~~~哈 ...
-
为什么 powerdesigner 15 inheritance功能是灰色的??急 急
使用PowerDesigner15试用版(已经破解)时,发现自己建立的CDM时在继承功能是...
-
powerdesigner里的table背景色是不是可以修改的
如题,在哪改?
------解决方案--------------------
Tools->Display Preferences-...