Skip to content

Tag: java

Complex function to cut a different decimal places after comma

The input data for the program is JSON with BigDecimal value like this example: 345.0197 I have 2 problems: Some fields has to display different number of digits after comma: 3 digits after comma like: 345.019 2 digits, like: 345.01 1 digit, like: 345.0 The integer before comma must have bigger text size than…

How to scale a PDAnnotation?

I have a pdf that has been passed to me with a signature (annotation) and I have to scale the pdf, but when I scale the pdf the annotation does not scale, and it comes out out out of shape. Any suggestions? I’ll show you the code of the method and the pdf before and after PDF BEFORE PDF AFTER

Parse JSON file with dynamic fields by java

How to parse JSON file with the object, which contains dynamic fields. As an example here: Here is “items”, which has objects with name(“1c68b853-2a07-4409-ad61-8650212f3260”) and body. And it’s more then 2 items. Answer You can easily use the Map interface, to store the dynamic …

Implementation of AspectJ example not working

I’m try to implement a simple AspectJ annotation example from https://www.baeldung.com/aspectj. The difference is, that I want to use the annotation at a JUnit TestClass. I googled a while for the solution but don’t find the right hint. Part of my pom.xml My Annotation: My Aspect: The Advice is me…