github.com/signintech/pdft@v0.5.0/minigopdf/cache_content_gray.go (about)

     1  package gopdf
     2  
     3  import (
     4  	"bytes"
     5  	"fmt"
     6  )
     7  
     8  const grayTypeFill = "g"
     9  const grayTypeStroke = "G"
    10  
    11  type cacheContentGray struct {
    12  	grayType string
    13  	scale    float64
    14  }
    15  
    16  func (c *cacheContentGray) toStream(protection *PDFProtection) (*bytes.Buffer, error) {
    17  	var buff bytes.Buffer
    18  	buff.WriteString(fmt.Sprintf("%.2f %s\n", c.scale, c.grayType))
    19  	return &buff, nil
    20  }