Fix PDF generation not accounting for text spacing [pdfium : main]

0 views
Skip to first unread message

Lei Zhang (Gerrit)

unread,
Mar 13, 2026, 7:44:21 PM (4 days ago) Mar 13
to Lei Zhang, Andy Phan, Pdfium LUCI CQ, pdfium-...@googlegroups.com
Attention needed from Andy Phan

Lei Zhang added 1 comment

File fpdfsdk/fpdf_edit_embeddertest.cpp
Line 5122, Patchset 1 (Parent): // TODO(crbug.com/461845674): The saved doc should have the same text spacing
Lei Zhang . resolved

Whoops, wrong bug number added in the previous CL. Deleting it now.

Open in Gerrit

Related details

Attention is currently required from:
  • Andy Phan
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: I43b79f0bef7a4f95dedbe0a2d604fdeb2fc63b54
Gerrit-Change-Number: 144830
Gerrit-PatchSet: 2
Gerrit-Owner: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Andy Phan <andy...@chromium.org>
Gerrit-Comment-Date: Fri, 13 Mar 2026 23:44:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andy Phan (Gerrit)

unread,
Mar 16, 2026, 12:58:44 PM (yesterday) Mar 16
to Lei Zhang, Pdfium LUCI CQ, pdfium-...@googlegroups.com
Attention needed from Lei Zhang

Andy Phan voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Lei Zhang
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: I43b79f0bef7a4f95dedbe0a2d604fdeb2fc63b54
Gerrit-Change-Number: 144830
Gerrit-PatchSet: 3
Gerrit-Owner: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Lei Zhang <the...@chromium.org>
Gerrit-Comment-Date: Mon, 16 Mar 2026 16:58:41 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Mar 16, 2026, 1:04:22 PM (yesterday) Mar 16
to Lei Zhang, Andy Phan, Pdfium LUCI CQ, pdfium-...@googlegroups.com

Lei Zhang voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: I43b79f0bef7a4f95dedbe0a2d604fdeb2fc63b54
Gerrit-Change-Number: 144830
Gerrit-PatchSet: 3
Gerrit-Owner: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Comment-Date: Mon, 16 Mar 2026 17:04:19 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Pdfium LUCI CQ (Gerrit)

unread,
Mar 16, 2026, 1:26:59 PM (yesterday) Mar 16
to Lei Zhang, Andy Phan, pdfium-...@googlegroups.com

Pdfium LUCI CQ submitted the change

Change information

Commit message:
Fix PDF generation not accounting for text spacing

Change CPDF_PageContentGenerator::ProcessText() to switch from the Tj
operator to the TJ operator. This allows the text data to contain both
character codes and spacing info. Use the data from
CPDF_TextObject::GetCharPositions() to fill in the spacing info. Then
update the "failing" FPDFEditEmbedderTest.Bug410996566 to use
testing/resources/embedder_tests/bug_410996566.png and variants, and
delete the now unused bug_410996566_wrong_spacing.png and variants.

Also make minor test expectation updates so other affected tests pass.

The first iteration of the CPDF_PageContentGenerator change was AI
generated.
Bug: 410996566
Change-Id: I43b79f0bef7a4f95dedbe0a2d604fdeb2fc63b54
Reviewed-by: Andy Phan <andy...@chromium.org>
Commit-Queue: Lei Zhang <the...@chromium.org>
Files:
  • M core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
  • M core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp
  • M fpdfsdk/fpdf_edit_embeddertest.cpp
  • M fpdfsdk/fpdf_save_embeddertest.cpp
  • D testing/resources/embedder_tests/bug_410996566_wrong_spacing.png
  • D testing/resources/embedder_tests/bug_410996566_wrong_spacing_agg_mac.png
  • D testing/resources/embedder_tests/bug_410996566_wrong_spacing_skia.png
  • D testing/resources/embedder_tests/bug_410996566_wrong_spacing_skia_mac.png
  • D testing/resources/embedder_tests/bug_410996566_wrong_spacing_skia_win.png
  • D testing/resources/embedder_tests/bug_410996566_wrong_spacing_skia_x86.png
Change size: S
Delta: 10 files changed, 25 insertions(+), 12 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Andy Phan
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: I43b79f0bef7a4f95dedbe0a2d604fdeb2fc63b54
Gerrit-Change-Number: 144830
Gerrit-PatchSet: 4
Gerrit-Owner: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages