mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
1 parent
1945ea355a
commit
f2dbf72885
15 files changed
+344
-21
No files matched your search
@@ -16,6 +16,7 @@ package ofdgo
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"image"
|
||||
|
||||
"github.com/tdewolff/canvas"
|
||||
"github.com/tdewolff/canvas/renderers/pdf"
|
||||
@@ -54,6 +55,16 @@ type pdfOutline struct {
|
||||
Y float64
|
||||
}
|
||||
|
||||
// RenderImage 在图像局部保存状态前同步不透明画笔,避免恢复后的透明度与后端缓存不一致
|
||||
// 入参: img 图像, matrix 图像变换
|
||||
func (r *pdfRenderer) RenderImage(img image.Image, matrix canvas.Matrix) {
|
||||
style := canvas.DefaultStyle
|
||||
style.Fill = canvas.Paint{Color: canvas.White}
|
||||
style.Stroke = canvas.Paint{Color: canvas.Black}
|
||||
r.PDF.RenderPath(&canvas.Path{}, style, canvas.Identity)
|
||||
r.PDF.RenderImage(img, matrix)
|
||||
}
|
||||
|
||||
// glyphPath 复用相似变换下的PDF字形圆弧转换
|
||||
// 入参: path 缓存字形路径, matrix 字形变换
|
||||
// 返回: *canvas.Path PDF字形路径
|
||||
|
||||
Reference in new issue
Block a user