You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you very much for this great project, which was very helpful.
The problem I am encountering now is that after adding a Chinese watermark with a custom font(KaiTi_GB2312), the file size has increased significantly. On the contrary, when using Adobe Acrobat to add watermarks with the same settings, the file size did not increase much.
From [Font] tab in [document property] with Adobe Acrobat, could find out file [-adobe-3.pdf] has only one KaiTi_GB2312 items and no [subset embedded] sign, and file [_cpu3.pdf] have three KaiTi_GB2312 items and has [subset embedded] sign on each one.
Suggestion
Would you consider adding an option for font embedding, as none, only used characters and full font, respectively represent no embedding, embedding only the characters used, and embedding the complete font file, refer to Adobe Acrobat's strategy, to reduce the size of final document? As many fonts are common on different devices.
As I found in file [_cpu3.pdf], the watermark has Chinese Characters and English alphabets, the designed customizing KaiTi_GB2312 font is valid to the Chinese Characters, but it seems invalid to English letters. How about add an option for customizing default font, as Chinese Character on one font, and alphabets for another font?
Thank you very much!
Document properties of sample-adobe-3.pdf, not embedded, size is small
Document properties of sample_cpu3.pdf, embedded 3 times, size increased significantly
The text was updated successfully, but these errors were encountered:
With the latest commit you can enforce that the stamp/watermark command will NOT embed your user font.
On the CLI you can now set scriptnameto one of the supported ISO-15924 font script codes: HANS, HANT, HIRA, KANA, JPAN, HANG, KORE
You can do: pdfcpu watermark add -m text -- "测试中文字体水印增加的文件大小\n2023-10-16" "font: KaiTi_GB2312, script:hans, points: 36, scale: 1 abs, color: #ff0000, op: 0.3, ro: 30" .\sample.pdf .\sample_cpu.pdf
Any user font name with the suffix GB2312 will be recognized using script HANA and therefore not embedded,
so your original command will also work: pdfcpu watermark add -m text -- "测试中文字体水印增加的文件大小\n2023-10-16" "font: KaiTi_GB2312, points: 36, scale: 1 abs, color: #ff0000, op: 0.3, ro: 30" .\sample.pdf .\sample_cpu.pdf
As far as 2) KaiTi_GB2312.ttf supports latin numbers, so that's a non issue.
Reusing a userfont for stamping/watermarking remains open.
Thank you very much for this great project, which was very helpful.
The problem I am encountering now is that after adding a Chinese watermark with a custom font(KaiTi_GB2312), the file size has increased significantly. On the contrary, when using Adobe Acrobat to add watermarks with the same settings, the file size did not increase much.
Files as attached.
KaiTi_GB2312.zip : The Font File, size: 3.94MB
sample.pdf : The original PDF document, size: 62.3KB
sample-adobe-1.pdf : Using Acrobat add 1 mark , size: 66.8KB
sample-adobe-3.pdf : Using Acrobat add 3 marks, size: 68.7KB
pdfcpu font install .\KaiTi_GB2312.ttf
pdfcpu watermark add -m text -- "测试中文字体水印增加的文件大小\n2023-10-16" "font: KaiTi_GB2312, points: 36, scale: 1 abs, color: #ff0000, op: 0.3, ro: 30" .\sample.pdf .\sample_cpu.pdf
sample_cpu.pdf, size: 1.11MB
.\pdfcpu.exe watermark add -m text -- "测试中文字体水印增加的文件大小\n2023-10-16" "font: KaiTi_GB2312, points: 36, scale: 1 abs, color: #ff0000, op: 0.3, ro: 30, offset: 0 220" .\sample_cpu.pdf .\sample_cpu2.pdf
sample_cpu2.pdf, size: 2.16MB
.\pdfcpu.exe watermark add -m text -- "测试中文字体水印增加的文件大小\n2023-10-16" "font: KaiTi_GB2312, points: 36, scale: 1 abs, color: #ff0000, op: 0.3, ro: 30, offset: 0 -220" .\sample_cpu2.pdf .\sample_cpu3.pdf
sample_cpu3.pdf, size: 3.22MB
From [Font] tab in [document property] with Adobe Acrobat, could find out file [-adobe-3.pdf] has only one KaiTi_GB2312 items and no [subset embedded] sign, and file [_cpu3.pdf] have three KaiTi_GB2312 items and has [subset embedded] sign on each one.
Suggestion
Thank you very much!
Document properties of sample-adobe-3.pdf, not embedded, size is small
Document properties of sample_cpu3.pdf, embedded 3 times, size increased significantly
The text was updated successfully, but these errors were encountered: