Re: PDFBox 3.0.1 / RandomAccessReadBuffer bug?

2024-02-07 Thread Andreas Lehmkühler

Hi David,

thanks for the bug report. You are right and the proposed solution seems 
to be a valid fix.


I've created https://issues.apache.org/jira/browse/PDFBOX-5764 to handle it.

Andreas

Am 08.02.24 um 00:00 schrieb david.kl...@atlas.cz:

Hello

  


I think that this is not correct in some cases:

  


   public RandomAccessReadBuffer(ByteBuffer input) {

 chunkSize = input.capacity();

  


IMHO input.limit() shoud be used instead of input.capacity().

  


When it matters: I have a ByteArrayOutputStream to that is written a PDF
document. Later I want to open the PDF document using PDFBox again. If I use
part of the internal buffer directly (without copying), eg.
ByteBuffer.wrap(bos.getInternalBuffer(), 0, bos.size()), I get exception
like that:

  


java.lang.IllegalArgumentException: newPosition > limit: (31556 > 20960)

  


 at
java.base/java.nio.Buffer.createPositionException(Buffer.java:352)

 at java.base/java.nio.Buffer.position(Buffer.java:327)

 at
java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1551)

 at
java.base/java.nio.ByteBuffer.position(ByteBuffer.java:285)

 at
org.apache.pdfbox.io.RandomAccessReadBuffer.seek(RandomAccessReadBuffer.java
:187)

 at
org.apache.pdfbox.pdfparser.COSParser.getStartxrefOffset(COSParser.java:506)

 at
org.apache.pdfbox.pdfparser.COSParser.retrieveTrailer(COSParser.java:259)

 at
org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:107)

 at
org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:171)

 at
org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:136)

 at org.apache.pdfbox.Loader.loadPDF(Loader.java:466)

 at org.apache.pdfbox.Loader.loadPDF(Loader.java:369)

  


31556 is the buffer capacity, 20960 is its limit

  


I think the buffer should not be read beyond its limit.

  


Regards

David Klika




-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Created] (PDFBOX-5764) Wrong chunksize when using a ByteBuffer to initialize a RandomAccessReadBuffer

2024-02-07 Thread Jira
Andreas Lehmkühler created PDFBOX-5764:
--

 Summary: Wrong chunksize when using a ByteBuffer to initialize a 
RandomAccessReadBuffer
 Key: PDFBOX-5764
 URL: https://issues.apache.org/jira/browse/PDFBOX-5764
 Project: PDFBox
  Issue Type: Bug
  Components: IO
Affects Versions: 3.0.1 PDFBox, 4.0.0
Reporter: Andreas Lehmkühler
Assignee: Andreas Lehmkühler
 Fix For: 3.0.2 PDFBox, 4.0.0


David Klika posted the following bug report on dev@
{quote}
I think that this is not correct in some cases:

 

  public RandomAccessReadBuffer(ByteBuffer input) {

chunkSize = input.capacity();

 

IMHO input.limit() shoud be used instead of input.capacity(). 


When it matters: I have a ByteArrayOutputStream to that is written a PDF
document. Later I want to open the PDF document using PDFBox again. If I use
part of the internal buffer directly (without copying), eg.
ByteBuffer.wrap(bos.getInternalBuffer(), 0, bos.size()), I get exception
like that:
{quote}
 
{code}
java.lang.IllegalArgumentException: newPosition > limit: (31556 > 20960)
at 
java.base/java.nio.Buffer.createPositionException(Buffer.java:352)
at java.base/java.nio.Buffer.position(Buffer.java:327)
at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1551)
at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:285)
at 
org.apache.pdfbox.io.RandomAccessReadBuffer.seek(RandomAccessReadBuffer.java
:187)
at 
org.apache.pdfbox.pdfparser.COSParser.getStartxrefOffset(COSParser.java:506)
at 
org.apache.pdfbox.pdfparser.COSParser.retrieveTrailer(COSParser.java:259)
at 
org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:107)
at 
org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:171)
at 
org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:136)
at org.apache.pdfbox.Loader.loadPDF(Loader.java:466)
at org.apache.pdfbox.Loader.loadPDF(Loader.java:369)
{code}
{quote}
 

31556 is the buffer capacity, 20960 is its limit

 

I think the buffer should not be read beyond its limit.
{quote}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



PDFBox 3.0.1 / RandomAccessReadBuffer bug?

2024-02-07 Thread david.klika
Hello

 

I think that this is not correct in some cases:

 

  public RandomAccessReadBuffer(ByteBuffer input) {

chunkSize = input.capacity();

 

IMHO input.limit() shoud be used instead of input.capacity(). 

 

When it matters: I have a ByteArrayOutputStream to that is written a PDF
document. Later I want to open the PDF document using PDFBox again. If I use
part of the internal buffer directly (without copying), eg.
ByteBuffer.wrap(bos.getInternalBuffer(), 0, bos.size()), I get exception
like that:

 

java.lang.IllegalArgumentException: newPosition > limit: (31556 > 20960)

 

at
java.base/java.nio.Buffer.createPositionException(Buffer.java:352)

at java.base/java.nio.Buffer.position(Buffer.java:327)

at
java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1551)

at
java.base/java.nio.ByteBuffer.position(ByteBuffer.java:285)

at
org.apache.pdfbox.io.RandomAccessReadBuffer.seek(RandomAccessReadBuffer.java
:187)

at
org.apache.pdfbox.pdfparser.COSParser.getStartxrefOffset(COSParser.java:506)

at
org.apache.pdfbox.pdfparser.COSParser.retrieveTrailer(COSParser.java:259)

at
org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:107)

at
org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:171)

at
org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:136)

at org.apache.pdfbox.Loader.loadPDF(Loader.java:466)

at org.apache.pdfbox.Loader.loadPDF(Loader.java:369)

 

31556 is the buffer capacity, 20960 is its limit

 

I think the buffer should not be read beyond its limit.

 

Regards

David Klika



Re: [PR] update some JavaDoc in Font-table classes [pdfbox]

2024-02-07 Thread via GitHub


THausherr commented on PR #182:
URL: https://github.com/apache/pdfbox/pull/182#issuecomment-1931993028

   Thanks, I applied your changes in the trunk and in 3.0 with some small 
modifications: only one IOException in the javadoc; some grammar changes. If 
I'm right about these, then it proves you were not using an AI, which is a good 
thing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-5660) Improve code quality (5)

2024-02-07 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-5660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17815287#comment-17815287
 ] 

ASF subversion and git services commented on PDFBOX-5660:
-

Commit 1915623 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1915623 ]

PDFBOX-5660: fix javadoc, as suggested by Dieter von Holten; closes #182

> Improve code quality (5)
> 
>
> Key: PDFBOX-5660
> URL: https://issues.apache.org/jira/browse/PDFBOX-5660
> Project: PDFBox
>  Issue Type: Improvement
>Reporter: Tilman Hausherr
>Priority: Minor
> Attachments: AnnotationSample.Standard.pdf, 
> DRY_refactoring_Typ2CharStringParser.patch, 
> Removed_the_readFully_method_in_the_PfbParser_class_and_replaced__with_calling_readAllByte.patch,
>  
> Simplify_list_and_map_operations,_use_known_size_when_creating_StringBuilder.patch,
>  Simplify_string_conversion_in_PDFHighlighter.patch, 
> avoid_multiple_unboxing.patch, code_cleanup.patch, 
> do_not_create_temporary_File_instance.patch, 
> extract_common_code,_move_toUpperCase()_out_of_loop.patch, 
> fix_HTML_error_in_Javadoc.patch, fix_javadoc_problems.patch, 
> make_inner_class_static.patch, refactor_isEndOfName.patch, 
> remove_code_duplication_in_Type2CharStringParser.patch, 
> remove_obsolete_class_NullOutputStream.patch, 
> remove_unnecessary_calls_to_toString()_String_valueOf().patch, 
> replace_System_getProperty()_calls.patch, screenshot-1.png, 
> simplify_hashCode()_and_equals(),_test_name_first_because_Map_equals()_is_expensive.patch,
>  simplify_stream_operations.patch, use_Map_ofEntries().patch, 
> use_Math_min()_to_make_code_more_readable.patch, use_Objects_equals().patch, 
> use_String_isEmpty()_Collection_isEmpty()_instead_of_checking_length_size.patch,
>  use_String_join().patch, use_switch_for_readability.patch, 
> use_try-with-resources_(since_Java_9_the_variable_declaration_in_the_try_is_not_necessary_.patch
>
>
> This is a longterm issue for the task to improve code quality, by using the 
> SonarQube report, hints in different IDEs, the FindBugs tool and other code 
> quality tools.
> This is a follow-up of PDFBOX-4892, which was getting too long.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Re: [PR] update some JavaDoc in Font-table classes [pdfbox]

2024-02-07 Thread via GitHub


asfgit closed pull request #182: update some JavaDoc in Font-table classes
URL: https://github.com/apache/pdfbox/pull/182


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-5660) Improve code quality (5)

2024-02-07 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-5660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17815285#comment-17815285
 ] 

ASF subversion and git services commented on PDFBOX-5660:
-

Commit 1915622 from Tilman Hausherr in branch 'pdfbox/branches/3.0'
[ https://svn.apache.org/r1915622 ]

PDFBOX-5660: fix javadoc, as suggested by Dieter von Holten

> Improve code quality (5)
> 
>
> Key: PDFBOX-5660
> URL: https://issues.apache.org/jira/browse/PDFBOX-5660
> Project: PDFBox
>  Issue Type: Improvement
>Reporter: Tilman Hausherr
>Priority: Minor
> Attachments: AnnotationSample.Standard.pdf, 
> DRY_refactoring_Typ2CharStringParser.patch, 
> Removed_the_readFully_method_in_the_PfbParser_class_and_replaced__with_calling_readAllByte.patch,
>  
> Simplify_list_and_map_operations,_use_known_size_when_creating_StringBuilder.patch,
>  Simplify_string_conversion_in_PDFHighlighter.patch, 
> avoid_multiple_unboxing.patch, code_cleanup.patch, 
> do_not_create_temporary_File_instance.patch, 
> extract_common_code,_move_toUpperCase()_out_of_loop.patch, 
> fix_HTML_error_in_Javadoc.patch, fix_javadoc_problems.patch, 
> make_inner_class_static.patch, refactor_isEndOfName.patch, 
> remove_code_duplication_in_Type2CharStringParser.patch, 
> remove_obsolete_class_NullOutputStream.patch, 
> remove_unnecessary_calls_to_toString()_String_valueOf().patch, 
> replace_System_getProperty()_calls.patch, screenshot-1.png, 
> simplify_hashCode()_and_equals(),_test_name_first_because_Map_equals()_is_expensive.patch,
>  simplify_stream_operations.patch, use_Map_ofEntries().patch, 
> use_Math_min()_to_make_code_more_readable.patch, use_Objects_equals().patch, 
> use_String_isEmpty()_Collection_isEmpty()_instead_of_checking_length_size.patch,
>  use_String_join().patch, use_switch_for_readability.patch, 
> use_try-with-resources_(since_Java_9_the_variable_declaration_in_the_try_is_not_necessary_.patch
>
>
> This is a longterm issue for the task to improve code quality, by using the 
> SonarQube report, hints in different IDEs, the FindBugs tool and other code 
> quality tools.
> This is a follow-up of PDFBOX-4892, which was getting too long.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-5660) Improve code quality (5)

2024-02-07 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-5660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17815278#comment-17815278
 ] 

ASF subversion and git services commented on PDFBOX-5660:
-

Commit 1915621 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1915621 ]

PDFBOX-5660: fix javadoc, as suggested by Dieter von Holten

> Improve code quality (5)
> 
>
> Key: PDFBOX-5660
> URL: https://issues.apache.org/jira/browse/PDFBOX-5660
> Project: PDFBox
>  Issue Type: Improvement
>Reporter: Tilman Hausherr
>Priority: Minor
> Attachments: AnnotationSample.Standard.pdf, 
> DRY_refactoring_Typ2CharStringParser.patch, 
> Removed_the_readFully_method_in_the_PfbParser_class_and_replaced__with_calling_readAllByte.patch,
>  
> Simplify_list_and_map_operations,_use_known_size_when_creating_StringBuilder.patch,
>  Simplify_string_conversion_in_PDFHighlighter.patch, 
> avoid_multiple_unboxing.patch, code_cleanup.patch, 
> do_not_create_temporary_File_instance.patch, 
> extract_common_code,_move_toUpperCase()_out_of_loop.patch, 
> fix_HTML_error_in_Javadoc.patch, fix_javadoc_problems.patch, 
> make_inner_class_static.patch, refactor_isEndOfName.patch, 
> remove_code_duplication_in_Type2CharStringParser.patch, 
> remove_obsolete_class_NullOutputStream.patch, 
> remove_unnecessary_calls_to_toString()_String_valueOf().patch, 
> replace_System_getProperty()_calls.patch, screenshot-1.png, 
> simplify_hashCode()_and_equals(),_test_name_first_because_Map_equals()_is_expensive.patch,
>  simplify_stream_operations.patch, use_Map_ofEntries().patch, 
> use_Math_min()_to_make_code_more_readable.patch, use_Objects_equals().patch, 
> use_String_isEmpty()_Collection_isEmpty()_instead_of_checking_length_size.patch,
>  use_String_join().patch, use_switch_for_readability.patch, 
> use_try-with-resources_(since_Java_9_the_variable_declaration_in_the_try_is_not_necessary_.patch
>
>
> This is a longterm issue for the task to improve code quality, by using the 
> SonarQube report, hints in different IDEs, the FindBugs tool and other code 
> quality tools.
> This is a follow-up of PDFBOX-4892, which was getting too long.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build is back to stable : PDFBox » PDFBox-Trunk-jdk20 » Apache PDFBox #923

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build became unstable: PDFBox » PDFBox-Trunk-jdk20 #922

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build became unstable: PDFBox » PDFBox-Trunk-jdk20 » Apache PDFBox #922

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build is back to stable : PDFBox » PDFBox-sonar2 #1281

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build is back to stable : PDFBox » PDFBox-sonar2 » Apache PDFBox #1281

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build is back to stable : PDFBox » PDFBox-Trunk-jdk21 » Apache PDFBox #967

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build is back to stable : PDFBox » PDFBox-trunk » Apache PDFBox #2009

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build is back to stable : PDFBox » PDFBox-trunk #2009

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build is back to stable : PDFBox » PDFBox-Trunk-jdk21 #967

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-5763) IllegalArgumentException: -Infinity is not a finite number

2024-02-07 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-5763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17815159#comment-17815159
 ] 

ASF subversion and git services commented on PDFBOX-5763:
-

Commit 1915616 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1915616 ]

PDFBOX-5763: add test

> IllegalArgumentException: -Infinity is not a finite number
> --
>
> Key: PDFBOX-5763
> URL: https://issues.apache.org/jira/browse/PDFBOX-5763
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.30, 3.0.1 PDFBox
>Reporter: Tilman Hausherr
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.31, 3.0.2 PDFBox, 4.0.0
>
>
> {noformat}
> Exception in thread "main" java.lang.IllegalArgumentException: -Infinity is 
> not a finite number
>   at 
> org.apache.pdfbox.pdmodel.PDAbstractContentStream.writeOperand(PDAbstractContentStream.java:1392)
>   at 
> org.apache.pdfbox.pdmodel.PDAbstractContentStream.setFont(PDAbstractContentStream.java:217)
>   at 
> org.apache.pdfbox.pdmodel.PDAppearanceContentStream.setFont(PDAppearanceContentStream.java:36)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.PDDefaultAppearanceString.writeTo(PDDefaultAppearanceString.java:297)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.insertGeneratedAppearance(AppearanceGeneratorHelper.java:531)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceContent(AppearanceGeneratorHelper.java:447)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceValue(AppearanceGeneratorHelper.java:263)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.PDTextField.constructAppearances(PDTextField.java:262)
> {noformat}
> I was able to reproduce it with the CreateSimpleForm example by using a 0 
> font size, an empty string and a field rectangle width of 1.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-5763) IllegalArgumentException: -Infinity is not a finite number

2024-02-07 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-5763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17815154#comment-17815154
 ] 

ASF subversion and git services commented on PDFBOX-5763:
-

Commit 1915615 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1915615 ]

PDFBOX-5763: revert accidental commit

> IllegalArgumentException: -Infinity is not a finite number
> --
>
> Key: PDFBOX-5763
> URL: https://issues.apache.org/jira/browse/PDFBOX-5763
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.30, 3.0.1 PDFBox
>Reporter: Tilman Hausherr
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.31, 3.0.2 PDFBox, 4.0.0
>
>
> {noformat}
> Exception in thread "main" java.lang.IllegalArgumentException: -Infinity is 
> not a finite number
>   at 
> org.apache.pdfbox.pdmodel.PDAbstractContentStream.writeOperand(PDAbstractContentStream.java:1392)
>   at 
> org.apache.pdfbox.pdmodel.PDAbstractContentStream.setFont(PDAbstractContentStream.java:217)
>   at 
> org.apache.pdfbox.pdmodel.PDAppearanceContentStream.setFont(PDAppearanceContentStream.java:36)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.PDDefaultAppearanceString.writeTo(PDDefaultAppearanceString.java:297)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.insertGeneratedAppearance(AppearanceGeneratorHelper.java:531)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceContent(AppearanceGeneratorHelper.java:447)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceValue(AppearanceGeneratorHelper.java:263)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.PDTextField.constructAppearances(PDTextField.java:262)
> {noformat}
> I was able to reproduce it with the CreateSimpleForm example by using a 0 
> font size, an empty string and a field rectangle width of 1.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build became unstable: PDFBox » PDFBox-sonar2 #1280

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build became unstable: PDFBox » PDFBox-sonar2 » Apache PDFBox #1280

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build became unstable: PDFBox » PDFBox-trunk #2008

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build became unstable: PDFBox » PDFBox-Trunk-jdk21 » Apache PDFBox #966

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build became unstable: PDFBox » PDFBox-trunk » Apache PDFBox #2008

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Jenkins build became unstable: PDFBox » PDFBox-Trunk-jdk21 #966

2024-02-07 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Resolved] (PDFBOX-5763) IllegalArgumentException: -Infinity is not a finite number

2024-02-07 Thread Tilman Hausherr (Jira)


 [ 
https://issues.apache.org/jira/browse/PDFBOX-5763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr resolved PDFBOX-5763.
-
Resolution: Fixed

> IllegalArgumentException: -Infinity is not a finite number
> --
>
> Key: PDFBOX-5763
> URL: https://issues.apache.org/jira/browse/PDFBOX-5763
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.30, 3.0.1 PDFBox
>Reporter: Tilman Hausherr
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.31, 3.0.2 PDFBox, 4.0.0
>
>
> {noformat}
> Exception in thread "main" java.lang.IllegalArgumentException: -Infinity is 
> not a finite number
>   at 
> org.apache.pdfbox.pdmodel.PDAbstractContentStream.writeOperand(PDAbstractContentStream.java:1392)
>   at 
> org.apache.pdfbox.pdmodel.PDAbstractContentStream.setFont(PDAbstractContentStream.java:217)
>   at 
> org.apache.pdfbox.pdmodel.PDAppearanceContentStream.setFont(PDAppearanceContentStream.java:36)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.PDDefaultAppearanceString.writeTo(PDDefaultAppearanceString.java:297)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.insertGeneratedAppearance(AppearanceGeneratorHelper.java:531)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceContent(AppearanceGeneratorHelper.java:447)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceValue(AppearanceGeneratorHelper.java:263)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.PDTextField.constructAppearances(PDTextField.java:262)
> {noformat}
> I was able to reproduce it with the CreateSimpleForm example by using a 0 
> font size, an empty string and a field rectangle width of 1.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Re: [PR] Use computed font height as font size [pdfbox]

2024-02-07 Thread via GitHub


THausherr commented on PR #183:
URL: https://github.com/apache/pdfbox/pull/183#issuecomment-1931495503

   I committed a modified code that only checks for infinity because 1) it's 
more clear, 2) the method still returns a negative font size if the vertical 
size is negative, however this has no bad effect. I also added a test. Thanks 
for the report!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-5763) IllegalArgumentException: -Infinity is not a finite number

2024-02-07 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-5763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17815150#comment-17815150
 ] 

ASF subversion and git services commented on PDFBOX-5763:
-

Commit 1915613 from Tilman Hausherr in branch 'pdfbox/branches/3.0'
[ https://svn.apache.org/r1915613 ]

PDFBOX-5763: avoid Infinity, as suggested by GooDer; closes #183

> IllegalArgumentException: -Infinity is not a finite number
> --
>
> Key: PDFBOX-5763
> URL: https://issues.apache.org/jira/browse/PDFBOX-5763
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.30, 3.0.1 PDFBox
>Reporter: Tilman Hausherr
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.31, 3.0.2 PDFBox, 4.0.0
>
>
> {noformat}
> Exception in thread "main" java.lang.IllegalArgumentException: -Infinity is 
> not a finite number
>   at 
> org.apache.pdfbox.pdmodel.PDAbstractContentStream.writeOperand(PDAbstractContentStream.java:1392)
>   at 
> org.apache.pdfbox.pdmodel.PDAbstractContentStream.setFont(PDAbstractContentStream.java:217)
>   at 
> org.apache.pdfbox.pdmodel.PDAppearanceContentStream.setFont(PDAppearanceContentStream.java:36)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.PDDefaultAppearanceString.writeTo(PDDefaultAppearanceString.java:297)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.insertGeneratedAppearance(AppearanceGeneratorHelper.java:531)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceContent(AppearanceGeneratorHelper.java:447)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceValue(AppearanceGeneratorHelper.java:263)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.PDTextField.constructAppearances(PDTextField.java:262)
> {noformat}
> I was able to reproduce it with the CreateSimpleForm example by using a 0 
> font size, an empty string and a field rectangle width of 1.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



Re: [PR] Use computed font height as font size [pdfbox]

2024-02-07 Thread via GitHub


asfgit closed pull request #183: Use computed font height as font size
URL: https://github.com/apache/pdfbox/pull/183


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-5763) IllegalArgumentException: -Infinity is not a finite number

2024-02-07 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-5763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17815149#comment-17815149
 ] 

ASF subversion and git services commented on PDFBOX-5763:
-

Commit 1915612 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1915612 ]

PDFBOX-5763: avoid Infinity, as suggested by GooDer; closes #183

> IllegalArgumentException: -Infinity is not a finite number
> --
>
> Key: PDFBOX-5763
> URL: https://issues.apache.org/jira/browse/PDFBOX-5763
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.30, 3.0.1 PDFBox
>Reporter: Tilman Hausherr
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.31, 3.0.2 PDFBox, 4.0.0
>
>
> {noformat}
> Exception in thread "main" java.lang.IllegalArgumentException: -Infinity is 
> not a finite number
>   at 
> org.apache.pdfbox.pdmodel.PDAbstractContentStream.writeOperand(PDAbstractContentStream.java:1392)
>   at 
> org.apache.pdfbox.pdmodel.PDAbstractContentStream.setFont(PDAbstractContentStream.java:217)
>   at 
> org.apache.pdfbox.pdmodel.PDAppearanceContentStream.setFont(PDAppearanceContentStream.java:36)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.PDDefaultAppearanceString.writeTo(PDDefaultAppearanceString.java:297)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.insertGeneratedAppearance(AppearanceGeneratorHelper.java:531)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceContent(AppearanceGeneratorHelper.java:447)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceValue(AppearanceGeneratorHelper.java:263)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.PDTextField.constructAppearances(PDTextField.java:262)
> {noformat}
> I was able to reproduce it with the CreateSimpleForm example by using a 0 
> font size, an empty string and a field rectangle width of 1.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-5763) IllegalArgumentException: -Infinity is not a finite number

2024-02-07 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-5763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17815148#comment-17815148
 ] 

ASF subversion and git services commented on PDFBOX-5763:
-

Commit 1915611 from Tilman Hausherr in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1915611 ]

PDFBOX-5763: avoid Infinity, as suggested by GooDer; closes #183

> IllegalArgumentException: -Infinity is not a finite number
> --
>
> Key: PDFBOX-5763
> URL: https://issues.apache.org/jira/browse/PDFBOX-5763
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.30, 3.0.1 PDFBox
>Reporter: Tilman Hausherr
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.31, 3.0.2 PDFBox, 4.0.0
>
>
> {noformat}
> Exception in thread "main" java.lang.IllegalArgumentException: -Infinity is 
> not a finite number
>   at 
> org.apache.pdfbox.pdmodel.PDAbstractContentStream.writeOperand(PDAbstractContentStream.java:1392)
>   at 
> org.apache.pdfbox.pdmodel.PDAbstractContentStream.setFont(PDAbstractContentStream.java:217)
>   at 
> org.apache.pdfbox.pdmodel.PDAppearanceContentStream.setFont(PDAppearanceContentStream.java:36)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.PDDefaultAppearanceString.writeTo(PDDefaultAppearanceString.java:297)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.insertGeneratedAppearance(AppearanceGeneratorHelper.java:531)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceContent(AppearanceGeneratorHelper.java:447)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceValue(AppearanceGeneratorHelper.java:263)
>   at 
> org.apache.pdfbox.pdmodel.interactive.form.PDTextField.constructAppearances(PDTextField.java:262)
> {noformat}
> I was able to reproduce it with the CreateSimpleForm example by using a 0 
> font size, an empty string and a field rectangle width of 1.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org