Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Copying text will add more space

Đang mở
#1,258 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
backend

Hướng nghiên cứu

Start by reproducing the copied-text spacing with the reported BaseFont and PdfContentByte.showTextAligned calls in OpenPDF 1.4.2. The issue does not identify a source file or test, so trace how positioned text is encoded for copying and add a regression test for the reported characters. Done means copied text has no extra spaces; the issue has had no comments for 638 days.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
Describe the bug

After adding the word according to the coordinate of the word, there will be an extra space after some words are copied.

To Reproduce

Code to reproduce the issue

Some core code:
BaseFont baseFont = BaseFont.createFont(curFontPath, BaseFont.IDENTITY_V, BaseFont.EMBEDDED);
PdfContentByte cb = writer.getDirectContentUnder();
cb.beginText();
cb.setFontAndSize(baseFont, fontHeight);
cb.setGState(gState);
cb.showTextAligned(PdfContentByte.ALIGN_LEFT, txt, x, y, 0);
cb.endText();

Expected behavior

We want the copied word to have no Spaces

Screenshots

image
郝𭣣 忠𫠡 陵

System
  • Used font:Inconvenient to provide
  • OpenPDF version:1.4.2
Ngôn ngữ chính
Java
Star
4.4k
Fork
714
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của LibrePDF/OpenPDF

Tất cả issue của LibrePDF/OpenPDF

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.