Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support of PdfIndirectObject for coordinates in /Rect, /BBox #1113

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

sa-sh
Copy link

@sa-sh sa-sh commented Mar 23, 2024

Description of the Bugfix

If annotation has /Rect which constist of PdfIndirectReference instead of PdfNumber, form flattening does not work
It throws exception like:

java.lang.IllegalArgumentException: Invalid argument. Float value (coordinate) expected! But was 8 0 R

	at com.lowagie.text.pdf.PdfRectangle.convertToFloat(PdfRectangle.java:169)
	at com.lowagie.text.pdf.PdfRectangle.<init>(PdfRectangle.java:163)
	at com.lowagie.text.pdf.PdfStamperImp.flatFields(PdfStamperImp.java:983)
	at com.lowagie.text.pdf.PdfStamperImp.close(PdfStamperImp.java:224)
	at com.lowagie.text.pdf.PdfStamper.close(PdfStamper.java:397)

Unit-Tests for the new Feature/Bugfix

[+] Unit-Tests added to cover the bug

Testing details

For testing added PDF that causes issue during form flattening,
with this fix - test passed

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@sa-sh
Copy link
Author

sa-sh commented Mar 27, 2024

is "1.3-java8" branch still open for bugfixes ?

@asturio
Copy link
Member

asturio commented Mar 27, 2024

is "1.3-java8" branch still open for bugfixes ?

Yes.

@asturio asturio merged commit 8863632 into LibrePDF:1.3-java8 Mar 27, 2024
3 of 5 checks passed
@asturio
Copy link
Member

asturio commented Mar 27, 2024

@sa-sh You may also cherry-pick these changes to 1.4 and master, so the newer versions have also the fixes.

@sa-sh sa-sh deleted the fix-for-form-flattening branch March 27, 2024 21:00
@sa-sh
Copy link
Author

sa-sh commented Mar 28, 2024

thank you, i will create another PR for master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants