#1466·pdfcpu

Add "SymbolEncoding" to the list of valid encodings in ValidationRelaxed mode

Author: vkostCreated Aug 20, 2026Updated Aug 29, 2026
Labelsfeature request

Hi, thank you for the wonderful library! I ran into a weird issue while testing today, and it looks like it should be easy to solve. I was trying to process a bunch of PDFs to list the info and compare the versions. With one PDF, I ran into this issue:

info: prepare PDF context: validation    
  error (obj#:31): document catalog: catalog Pages: page tree: page obj#11: Font resource F15: font dict Subtype      
  Type1: type1FontDict.Encoding: invalid encoding name "SymbolEncoding".

Digging through the code, I found this in pkg/pdfcpu/validate/font.go

encodings := []string{"MacRomanEncoding", "MacExpertEncoding", "WinAnsiEncoding"}
	if xRefTable.ValidationMode == model.ValidationRelaxed {
		encodings = append(encodings, "FontSpecific", "StandardEncoding", "SymbolSetEncoding", "PDFDocEncoding")
	}

I see 'SymbolSetEncoding' is in the list, but this PDF of mine has 'SymbolEncoding'. So, it fails the validation, even though the file opens just fine in PDF reader on my Macbook Pro. I tested Apple Preview and Adobe Acrobat - the file opens just fine.

I can do the PR if that helps - my goal is simply to add this new encoding. A more complete solution would be to allow passing additional valid symbol sets in config, but that's more work, of course.

I'm using github.com/pdfcpu/pdfcpu@latest, pulled just today. I'm on Go 1.26, but I don't think that's relevant.

Thank you Vic