pdf

package
v0.0.0-...-4a26633 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataProtector

type DataProtector interface {
	ReadPdfContent(f *os.File, r *pdfreader.Reader) (string, error)
	ConvertPdfToImages(filePath string, resolution float64, compressionQuality uint) (imgs []Image, err error)
	DataProtect(imges []Image, msk MaskBlock, pixs []PixPoint) (maskImgs []Image, err error)
	WritePdf(imgesPath []string) (err error)
	Destory()
}

type Image

type Image struct {
	FilePath string
	Width    uint
	Height   uint
}

type Location

type Location struct {
	Start  PixPoint
	End    PixPoint
	Length float64
	Page   int
}

func TransImagePtToPix

func TransImagePtToPix(ppmap map[string][]Location, imageHeight uint, ppi float64, fontSize float64) (pixLocs []Location)

type MaskBlock

type MaskBlock struct {
	Cols uint
	Rows uint
}

type MaskPix

type MaskPix struct {
	StartPixs PixPoint
	Len       float64
}

type PdfDtProtector

type PdfDtProtector struct {
	PWidth    uint
	PHeight   uint
	PfontSize float64
	// contains filtered or unexported fields
}

func NewPdfDtProtector

func NewPdfDtProtector() PdfDtProtector

func (*PdfDtProtector) ConvertPdfToImages

func (pdp *PdfDtProtector) ConvertPdfToImages(resolution float64, compressionQuality uint) (imgs []Image, err error)

func (*PdfDtProtector) DataProtect

func (pdp *PdfDtProtector) DataProtect(imges []Image, maskRows uint, pixsLocation []Location) (maskImgs []Image, err error)

func (*PdfDtProtector) Destory

func (pdp *PdfDtProtector) Destory()

func (*PdfDtProtector) FindSensitiveData

func (pdp *PdfDtProtector) FindSensitiveData(datas []SensiteiveData) (ppmap map[string][]Location, err error)

func (*PdfDtProtector) GetPdfPlainText

func (pdp *PdfDtProtector) GetPdfPlainText() ([]string, error)

func (*PdfDtProtector) IsIncludeSensiteiveData

func (pdp *PdfDtProtector) IsIncludeSensiteiveData(regxExpr string) (include bool, matchs []SensiteiveData, err error)

func (*PdfDtProtector) PdfOpen

func (pdp *PdfDtProtector) PdfOpen(filePath string) (err error)

func (*PdfDtProtector) ReadAndCachePdfContent

func (pdp *PdfDtProtector) ReadAndCachePdfContent() (err error)

func (*PdfDtProtector) WritePdf

func (pdp *PdfDtProtector) WritePdf(imges []Image) (err error)

type PixPoint

type PixPoint struct {
	X float64
	Y float64
}

type SensiteiveData

type SensiteiveData struct {
	Datas []string
	Page  int
}

type Text

type Text struct {
	Page int
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL