c# - PdfContentByte.SetColorFill vs. PdfContentByte.SetRGBColorFill and how to write strikethrough text -


1) what's difference between 2 methods setcolorfill , setrgbcolorfill on pdfcontentbyte class?

is latter lets input rgb color values?

2) how write strike-through text? reading documentation, assumed pdfcontentbyte.setrgbcolorstrike meant define color of strike-through text. so, called method. now, want write text strike-through. how do that?

you inventing new methods. there no setrgbcolorstrike() method in itext. confusing strike stroke. please download "the abc of pdf itext". free book writing (only 4 chapters finished far).

in chapter 4, you'll learn pdf syntax used construct paths. instance: can construct triangle using 1 moveto() , 3 lineto() methods. constructing path doesn't draw on page. shape drawn if perform fill, stroke or fill , stroke operation (there different ways this).

  • fill fills shape current fill color. shape have no border.
  • stroke strokes shape without filling it. you'll see lines , curves drawn using current stroke color.
  • fill , stroke fill path using current fill color , draw lines , curves using current stroke color.

as can see, setrgbcolorstroke() irrelevant if want strike through text. strike through text, need chunk.setunderline() method define y value in such way text isn't underlined, stricken. calling method multiple times on same chunk allows add double, triple,... lines. explained in chapter 2 of "itext in action" book. chapter available free. quote page 30:

the parameter sets y position allows use same method strike line through chunk.

for sake of completeness: there different color spaces in pdf (graycolor, rgb, cmyk,...), hence there different method set color. instance: setcolorfill() @ color value passed , use pdf operator corresponds color space of colorvalue. setrgbcolorfill() method use pdf operator corresponds devicergb color space.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -