Skip to content

OFD发票转为PNG 参考GBT_33190-2016_电子文件存储与交换格式版式文档.pdf.

License

Notifications You must be signed in to change notification settings

geniusnut/ofd2img

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ofd2img

Prerequisite

  1. Install PyGobject. https://pygobject.readthedocs.io/en/latest/getting_started.html#windows-getting-started
  2. Install Jbig2Dec 不要用brew install (brew info jbig2dec)的那个,好像只支持转出为pbm,不支持png。 自己安装下。
git clone https://github.com/ArtifexSoftware/jbig2dec 
cd jbig2dec
./autogen && make && make install
jbig2dec -o image_80.png Doc_0/Res/image_80.jb2

Usage

安装好对应的依赖,调用OFDFile.draw_document会生成发票的PNG图片。

from core.document import OFDFile
doc = OFDFile('test.ofd')
doc.draw_document()  
# check test_Doc_0_Page_0.png under folder

Need Help?

有任何问题请提Issue或者联系 [email protected]

Issues

发票签章位置Hardcode。

About

OFD发票转为PNG 参考GBT_33190-2016_电子文件存储与交换格式版式文档.pdf.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages