Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contentstream/creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,15 +825,15 @@ func (cc *ContentCreator) Add_quote(textstr core.PdfObjectString) *ContentCreato
return cc
}

// Add_quotes appends "''" operand to the content stream:
// Add_quotes appends `"` operand to the content stream:
// Move to next line and show a string, using `aw` and `ac` as word
// and character spacing respectively.
//
// See section 9.4.3 "Text Showing Operators" and
// Table 209 (pp. 258-259 PDF32000_2008).
func (cc *ContentCreator) Add_quotes(textstr core.PdfObjectString, aw, ac float64) *ContentCreator {
op := ContentStreamOperation{}
op.Operand = "''"
op.Operand = `"`
op.Params = makeParamsFromFloats([]float64{aw, ac})
op.Params = append(op.Params, makeParamsFromStrings([]core.PdfObjectString{textstr})...)
cc.operands = append(cc.operands, &op)
Expand Down
2 changes: 1 addition & 1 deletion contentstream/operand_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ var validOperands = map[string]struct{}{
"W*": struct{}{},
"y": struct{}{},
`'`: struct{}{},
`''`: struct{}{},
`"`: struct{}{},
}
2 changes: 1 addition & 1 deletion extractor/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (e *Extractor) extractPageText(contents string, resources *model.PdfPageRes
to.nextLine()
return to.showText(charcodes)
case `"`: // Set word and character spacing, move to next line, and show text.
if ok, err := to.checkOp(op, 1, true); !ok {
if ok, err := to.checkOp(op, 3, true); !ok {
common.Log.Debug("ERROR: \" err=%v", err)
return err
}
Expand Down
2 changes: 1 addition & 1 deletion render/internal/context/text_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (ts *TextState) ProcQ(data []byte, ctx Context) {
ts.ProcTj(data, ctx)
}

// ProcDQ processes a `''` operation, which advances the text state to a new
// ProcDQ processes a `"` operation, which advances the text state to a new
// line and then displays a text string using aw and ac as word and character
// spacing.
//
Expand Down
2 changes: 1 addition & 1 deletion render/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ func (r renderer) renderContentStream(ctx context.Context, contents string, reso

textState.ProcQ(charcodes, ctx)
// Move to the next line and show text string.
case `''`:
case `"`:
if len(op.Params) != 3 {
return errRange
}
Expand Down