From 37aa0612df8cce5afd9294e07b2a60c57feb7923 Mon Sep 17 00:00:00 2001 From: Kai Yuan Date: Sun, 31 Dec 2023 16:24:53 +0100 Subject: [PATCH 1/4] [str-length] string length vs string.bytes.length (#15518) * [str-length] string length vs string.bytes.length * [str-length] add relative path to the core-java-modules --- ...tringLengthAndByteArrayLengthUnitTest.java | 49 +++++++++++++++++++ core-java-modules/pom.xml | 1 + 2 files changed, 50 insertions(+) create mode 100644 core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/aboutlength/StringLengthAndByteArrayLengthUnitTest.java diff --git a/core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/aboutlength/StringLengthAndByteArrayLengthUnitTest.java b/core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/aboutlength/StringLengthAndByteArrayLengthUnitTest.java new file mode 100644 index 0000000000..94c855acb9 --- /dev/null +++ b/core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/aboutlength/StringLengthAndByteArrayLengthUnitTest.java @@ -0,0 +1,49 @@ +package com.baeldung.aboutlength; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.charset.Charset; + +import org.junit.jupiter.api.Test; + +public class StringLengthAndByteArrayLengthUnitTest { + + @Test + void whenStrWithAllAsciiChar_thenStrLengthAndBytesLengthAreEqual() { + String s = "beautiful"; + assertEquals(9, s.length()); + assertEquals(9, s.getBytes().length); + } + + @Test + void whenStrWithUnicodeChar_thenStrLengthAndBytesLengthAreNotEqual() { + assertEquals("f6", Integer.toHexString('ö')); + assertEquals("7f8e", Integer.toHexString('美')); + assertEquals("4e3d", Integer.toHexString('丽')); + + String de = "schöne"; + assertEquals(6, de.length()); + assertEquals(7, de.getBytes().length); + + String cn = "美丽"; + assertEquals(2, cn.length()); + assertEquals(6, cn.getBytes().length); + } + + @Test + void whenUsingUTF_32_thenBytesLengthIs4TimesStrLength() { + Charset UTF_32 = Charset.forName("UTF_32"); + + String en = "beautiful"; + assertEquals(9, en.length()); + assertEquals(9 * 4, en.getBytes(UTF_32).length); + + String de = "schöne"; + assertEquals(6, de.length()); + assertEquals(6 * 4, de.getBytes(UTF_32).length); + + String cn = "美丽"; + assertEquals(2, cn.length()); + assertEquals(2 * 4, cn.getBytes(UTF_32).length); + } +} \ No newline at end of file diff --git a/core-java-modules/pom.xml b/core-java-modules/pom.xml index a661c11749..16d01dd1d3 100644 --- a/core-java-modules/pom.xml +++ b/core-java-modules/pom.xml @@ -12,6 +12,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT + .. From 324082f9a8c65230eb1d7746e8cb1c0424f80ab6 Mon Sep 17 00:00:00 2001 From: Amit Pandey Date: Sun, 31 Dec 2023 21:08:52 +0530 Subject: [PATCH 2/4] JAVA-28931 :- Made changes to upgrade to Spring Boot 3 (#15516) * Made changes to upgrade to Spring Boot 3 * Minor fixes * Minor fixes --- persistence-modules/fauna/pom.xml | 6 ++++-- .../faunablog/WebSecurityConfiguration.java | 18 +++++++++--------- .../faunablog/posts/PostsController.java | 1 - .../baeldung/faunablog/posts/PostsService.java | 1 - .../users/FaunaUserDetailsService.java | 5 ++++- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/persistence-modules/fauna/pom.xml b/persistence-modules/fauna/pom.xml index 4c37c2ae9e..3a34ad3ca1 100644 --- a/persistence-modules/fauna/pom.xml +++ b/persistence-modules/fauna/pom.xml @@ -9,9 +9,9 @@ com.baeldung - parent-boot-2 + parent-boot-3 0.0.1-SNAPSHOT - ../../parent-boot-2 + ../../parent-boot-3 @@ -59,6 +59,8 @@ 4.2.0 + 17 + com.baeldung.faunablog.FaunaBlogApplication \ No newline at end of file diff --git a/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/WebSecurityConfiguration.java b/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/WebSecurityConfiguration.java index 12770c47ce..005f1751ea 100644 --- a/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/WebSecurityConfiguration.java +++ b/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/WebSecurityConfiguration.java @@ -5,15 +5,17 @@ import com.faunadb.client.FaunaClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.Customizer; +import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configurers.CsrfConfigurer; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.web.SecurityFilterChain; @Configuration @EnableWebSecurity -@EnableGlobalMethodSecurity(prePostEnabled = true) +@EnableMethodSecurity public class WebSecurityConfiguration { @Autowired @@ -21,13 +23,11 @@ public class WebSecurityConfiguration { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { - http.csrf() - .disable(); - http.authorizeRequests() - .antMatchers("/**") - .permitAll() - .and() - .httpBasic(); + http.csrf(CsrfConfigurer::disable) + .authorizeHttpRequests(requests -> requests + .requestMatchers("/**") + .permitAll()) + .httpBasic(Customizer.withDefaults()); return http.build(); } diff --git a/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/posts/PostsController.java b/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/posts/PostsController.java index e8e6316ea8..37701ae531 100644 --- a/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/posts/PostsController.java +++ b/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/posts/PostsController.java @@ -6,7 +6,6 @@ import org.springframework.http.HttpStatus; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.bind.annotation.*; -import org.springframework.web.server.ResponseStatusException; import java.util.List; import java.util.concurrent.ExecutionException; diff --git a/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/posts/PostsService.java b/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/posts/PostsService.java index 5143a24b28..5865c1af49 100644 --- a/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/posts/PostsService.java +++ b/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/posts/PostsService.java @@ -6,7 +6,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.time.Instant; -import java.util.Collection; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; diff --git a/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/users/FaunaUserDetailsService.java b/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/users/FaunaUserDetailsService.java index 2e88aaa477..d0ddea3f69 100644 --- a/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/users/FaunaUserDetailsService.java +++ b/persistence-modules/fauna/src/main/java/com/baeldung/faunablog/users/FaunaUserDetailsService.java @@ -6,6 +6,8 @@ import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.security.crypto.factory.PasswordEncoderFactories; +import org.springframework.security.crypto.password.PasswordEncoder; import java.util.concurrent.ExecutionException; @@ -30,8 +32,9 @@ public class FaunaUserDetailsService implements UserDetailsService { if (userData == null) { throw new UsernameNotFoundException("User not found"); } + PasswordEncoder encoder = PasswordEncoderFactories.createDelegatingPasswordEncoder(); - return User.withDefaultPasswordEncoder() + return User.builder().passwordEncoder(encoder::encode) .username(userData.at("data", "username").to(String.class).orNull()) .password(userData.at("data", "password").to(String.class).orNull()) .roles("USER") From 1768eee09f7dff04ad7c4d95c9ec459a25833b23 Mon Sep 17 00:00:00 2001 From: Azhwani <13301425+azhwani@users.noreply.github.com> Date: Sun, 31 Dec 2023 17:35:36 +0100 Subject: [PATCH 3/4] BAEL-6979: How to fix Hibernate QueryException: Named parameter not bound (#15451) --- .../persistentobject/HibernateUtil.java | 2 + .../namedparameternotbound/Person.java | 38 +++++++++++++ ...medParameterNotBoundExceptionUnitTest.java | 53 +++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 persistence-modules/hibernate-exceptions/src/main/java/com/baeldung/hibernate/namedparameternotbound/Person.java create mode 100644 persistence-modules/hibernate-exceptions/src/test/java/com/baeldung/hibernate/namedparameternotbound/NamedParameterNotBoundExceptionUnitTest.java diff --git a/persistence-modules/hibernate-exceptions/src/main/java/com/baeldung/hibernate/exception/persistentobject/HibernateUtil.java b/persistence-modules/hibernate-exceptions/src/main/java/com/baeldung/hibernate/exception/persistentobject/HibernateUtil.java index 641b80b412..bbf8f46e82 100644 --- a/persistence-modules/hibernate-exceptions/src/main/java/com/baeldung/hibernate/exception/persistentobject/HibernateUtil.java +++ b/persistence-modules/hibernate-exceptions/src/main/java/com/baeldung/hibernate/exception/persistentobject/HibernateUtil.java @@ -11,6 +11,7 @@ import org.hibernate.service.ServiceRegistry; import com.baeldung.hibernate.exception.persistentobject.entity.Article; import com.baeldung.hibernate.exception.persistentobject.entity.Author; import com.baeldung.hibernate.exception.persistentobject.entity.Book; +import com.baeldung.hibernate.namedparameternotbound.Person; public class HibernateUtil { private static SessionFactory sessionFactory; @@ -34,6 +35,7 @@ public class HibernateUtil { configuration.addAnnotatedClass(Book.class); configuration.addAnnotatedClass(Author.class); configuration.addAnnotatedClass(Article.class); + configuration.addAnnotatedClass(Person.class); ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder() .applySettings(configuration.getProperties()).build(); diff --git a/persistence-modules/hibernate-exceptions/src/main/java/com/baeldung/hibernate/namedparameternotbound/Person.java b/persistence-modules/hibernate-exceptions/src/main/java/com/baeldung/hibernate/namedparameternotbound/Person.java new file mode 100644 index 0000000000..e5f5ebc4a0 --- /dev/null +++ b/persistence-modules/hibernate-exceptions/src/main/java/com/baeldung/hibernate/namedparameternotbound/Person.java @@ -0,0 +1,38 @@ +package com.baeldung.hibernate.namedparameternotbound; + +import jakarta.persistence.Entity; +import jakarta.persistence.Id; + +@Entity +public class Person { + + @Id + private int id; + private String firstName; + private String lastName; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + +} diff --git a/persistence-modules/hibernate-exceptions/src/test/java/com/baeldung/hibernate/namedparameternotbound/NamedParameterNotBoundExceptionUnitTest.java b/persistence-modules/hibernate-exceptions/src/test/java/com/baeldung/hibernate/namedparameternotbound/NamedParameterNotBoundExceptionUnitTest.java new file mode 100644 index 0000000000..f16a89917d --- /dev/null +++ b/persistence-modules/hibernate-exceptions/src/test/java/com/baeldung/hibernate/namedparameternotbound/NamedParameterNotBoundExceptionUnitTest.java @@ -0,0 +1,53 @@ +package com.baeldung.hibernate.namedparameternotbound; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.hibernate.QueryException; +import org.hibernate.Session; +import org.hibernate.query.Query; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import com.baeldung.hibernate.exception.persistentobject.HibernateUtil; + +class NamedParameterNotBoundExceptionUnitTest { + + private static Session session; + + @BeforeAll + static void init() { + session = HibernateUtil.getSessionFactory() + .openSession(); + session.beginTransaction(); + } + + @AfterAll + static void clear() { + session.close(); + } + + @Test + void whenSettingValueToNamedParameter_thenDoNotThrowQueryException() { + Query query = session.createQuery("FROM Person p WHERE p.firstName = :firstName", Person.class); + query.setParameter("firstName", "Azhrioun"); + + assertNotNull(query.list()); + } + + @Test + void whenNotSettingValueToNamedParameter_thenThrowQueryException() { + Exception exception = assertThrows(QueryException.class, () -> { + Query query = session.createQuery("FROM Person p WHERE p.firstName = :firstName", Person.class); + query.list(); + }); + + String expectedMessage = "Named parameter not bound"; + String actualMessage = exception.getMessage(); + + assertTrue(actualMessage.contains(expectedMessage)); + } + +} From 76bde3ff4648cc081a66ea5d07fe5152449dde81 Mon Sep 17 00:00:00 2001 From: anuragkumawat Date: Sun, 31 Dec 2023 08:37:40 -0800 Subject: [PATCH 4/4] JAVA-29281 Create new module Text Processing Libraries Modules (#15479) --- pom.xml | 12 +- text-processing-libraries-modules/README.md | 3 + .../antlr}/README.md | 0 .../antlr}/pom.xml | 2 +- .../main/antlr4/com/baeldung/antlr/Java8.g4 | 0 .../src/main/antlr4/com/baeldung/antlr/Log.g4 | 0 .../antlr/java/UppercaseMethodListener.java | 0 .../com/baeldung/antlr/log/LogListener.java | 0 .../baeldung/antlr/log/model/LogEntry.java | 0 .../baeldung/antlr/log/model/LogLevel.java | 0 .../antlr}/src/main/resources/logback.xml | 0 .../baeldung/antlr/JavaParserUnitTest.java | 0 .../com/baeldung/antlr/LogParserUnitTest.java | 0 .../apache-tika}/README.md | 0 .../apache-tika}/pom.xml | 2 +- .../java/com/baeldung/tika/TikaAnalysis.java | 0 .../src/main/resources/logback.xml | 0 .../java/com/baeldung/tika/TikaUnitTest.java | 0 .../apache-tika}/src/test/resources/tika.docx | Bin .../apache-tika}/src/test/resources/tika.txt | Bin .../apache-tika}/src/test/resources/tika.xlsx | Bin .../asciidoctor}/README.md | 0 .../asciidoctor}/log4j.properties | 0 .../asciidoctor}/pom.xml | 2 +- .../asciidoctor}/src/docs/asciidoc/test.adoc | 0 .../baeldung/asciidoctor/AsciidoctorDemo.java | 0 .../src/main/resources/logback.xml | 0 .../AsciidoctorDemoIntegrationTest.java | 0 .../asciidoctor}/src/themes/custom-theme.yml | 0 .../pdf-2}/README.md | 0 .../pdf-2}/pom.xml | 2 +- .../exceltopdf/ExcelToPDFConverter.java | 0 .../pdfedition/PdfContentRemover.java | 86 ++++----- .../com/baeldung/pdfedition/PdfEditor.java | 172 +++++++++--------- .../pdfedition/PdfTextReplacement.java | 90 ++++----- .../com/baeldung/pdfinfo/PdfInfoIText.java | 0 .../com/baeldung/pdfinfo/PdfInfoPdfBox.java | 0 .../src/main/resources/baeldung-cleaned.pdf | Bin .../src/main/resources/baeldung-fixed.pdf | Bin .../src/main/resources/baeldung-modified.pdf | Bin .../pdf-2}/src/main/resources/baeldung.pdf | Bin .../pdf-2}/src/main/resources/baeldung.png | Bin .../src/main/resources/excelsample.xlsx | Bin .../pdf-2}/src/main/resources/pdfsample.pdf | 0 .../pdfinfo/PdfInfoITextUnitTest.java | 0 .../pdfinfo/PdfInfoPdfBoxUnitTest.java | 0 .../pdf-2}/src/test/resources/input.pdf | Bin .../pdf}/.gitignore | 0 .../pdf}/README.md | 0 .../pdf}/input.docx | Bin .../pdf}/output.pdf | Bin .../pdf}/pom.xml | 2 +- .../pdf}/sample.pdf | Bin .../com/baeldung/pdf/DocxToPDFExample.java | 0 .../com/baeldung/pdf/PDF2HTMLExample.java | 0 .../com/baeldung/pdf/PDF2ImageExample.java | 0 .../com/baeldung/pdf/PDF2TextExample.java | 0 .../com/baeldung/pdf/PDF2WordExample.java | 0 .../java/com/baeldung/pdf/PDFSampleMain.java | 0 .../pdf/openpdf/CustomElementFactoryImpl.java | 0 .../openpdf/Html2PdfUsingFlyingSaucer.java | 0 .../pdf/openpdf/Html2PdfUsingOpenHtml.java | 0 .../pdfthymeleaf/PDFThymeleafExample.java | 0 .../pdf}/src/main/resources/Java_logo.png | Bin .../pdf}/src/main/resources/html.html | 0 .../pdf}/src/main/resources/html2pdf.pdf | Bin .../src/main/resources/htmlforopenpdf.html | 0 .../pdf}/src/main/resources/logback.xml | 0 .../pdf}/src/main/resources/pdf.pdf | Bin .../pdf}/src/main/resources/style.css | 0 .../main/resources/thymeleaf_template.html | 0 .../pdf}/src/main/resources/txt.txt | 0 .../pdf/base64/EncodeDecodeUnitTest.java | 0 .../pdfreadertest/ReadPdfFileUnitTest.java | 0 .../pdfthymeleaf/PDFThymeleafUnitTest.java | 0 .../pdf}/src/test/resources/input.pdf | Bin .../pdf}/src/test/resources/output.pdf | Bin text-processing-libraries-modules/pom.xml | 24 +++ 78 files changed, 208 insertions(+), 189 deletions(-) create mode 100644 text-processing-libraries-modules/README.md rename {antlr => text-processing-libraries-modules/antlr}/README.md (100%) rename {antlr => text-processing-libraries-modules/antlr}/pom.xml (96%) rename {antlr => text-processing-libraries-modules/antlr}/src/main/antlr4/com/baeldung/antlr/Java8.g4 (100%) rename {antlr => text-processing-libraries-modules/antlr}/src/main/antlr4/com/baeldung/antlr/Log.g4 (100%) rename {antlr => text-processing-libraries-modules/antlr}/src/main/java/com/baeldung/antlr/java/UppercaseMethodListener.java (100%) rename {antlr => text-processing-libraries-modules/antlr}/src/main/java/com/baeldung/antlr/log/LogListener.java (100%) rename {antlr => text-processing-libraries-modules/antlr}/src/main/java/com/baeldung/antlr/log/model/LogEntry.java (100%) rename {antlr => text-processing-libraries-modules/antlr}/src/main/java/com/baeldung/antlr/log/model/LogLevel.java (100%) rename {antlr => text-processing-libraries-modules/antlr}/src/main/resources/logback.xml (100%) rename {antlr => text-processing-libraries-modules/antlr}/src/test/java/com/baeldung/antlr/JavaParserUnitTest.java (100%) rename {antlr => text-processing-libraries-modules/antlr}/src/test/java/com/baeldung/antlr/LogParserUnitTest.java (100%) rename {apache-tika => text-processing-libraries-modules/apache-tika}/README.md (100%) rename {apache-tika => text-processing-libraries-modules/apache-tika}/pom.xml (92%) rename {apache-tika => text-processing-libraries-modules/apache-tika}/src/main/java/com/baeldung/tika/TikaAnalysis.java (100%) rename {apache-tika => text-processing-libraries-modules/apache-tika}/src/main/resources/logback.xml (100%) rename {apache-tika => text-processing-libraries-modules/apache-tika}/src/test/java/com/baeldung/tika/TikaUnitTest.java (100%) rename {apache-tika => text-processing-libraries-modules/apache-tika}/src/test/resources/tika.docx (100%) rename {apache-tika => text-processing-libraries-modules/apache-tika}/src/test/resources/tika.txt (100%) rename {apache-tika => text-processing-libraries-modules/apache-tika}/src/test/resources/tika.xlsx (100%) rename {asciidoctor => text-processing-libraries-modules/asciidoctor}/README.md (100%) rename {asciidoctor => text-processing-libraries-modules/asciidoctor}/log4j.properties (100%) rename {asciidoctor => text-processing-libraries-modules/asciidoctor}/pom.xml (97%) rename {asciidoctor => text-processing-libraries-modules/asciidoctor}/src/docs/asciidoc/test.adoc (100%) rename {asciidoctor => text-processing-libraries-modules/asciidoctor}/src/main/java/com/baeldung/asciidoctor/AsciidoctorDemo.java (100%) rename {asciidoctor => text-processing-libraries-modules/asciidoctor}/src/main/resources/logback.xml (100%) rename {asciidoctor => text-processing-libraries-modules/asciidoctor}/src/test/java/com/baeldung/asciidoctor/AsciidoctorDemoIntegrationTest.java (100%) rename {asciidoctor => text-processing-libraries-modules/asciidoctor}/src/themes/custom-theme.yml (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/README.md (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/pom.xml (97%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/main/java/com/baeldung/exceltopdf/ExcelToPDFConverter.java (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/main/java/com/baeldung/pdfedition/PdfContentRemover.java (97%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/main/java/com/baeldung/pdfedition/PdfEditor.java (97%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/main/java/com/baeldung/pdfedition/PdfTextReplacement.java (97%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/main/java/com/baeldung/pdfinfo/PdfInfoIText.java (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/main/java/com/baeldung/pdfinfo/PdfInfoPdfBox.java (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/main/resources/baeldung-cleaned.pdf (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/main/resources/baeldung-fixed.pdf (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/main/resources/baeldung-modified.pdf (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/main/resources/baeldung.pdf (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/main/resources/baeldung.png (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/main/resources/excelsample.xlsx (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/main/resources/pdfsample.pdf (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/test/java/com/baeldung/pdfinfo/PdfInfoITextUnitTest.java (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/test/java/com/baeldung/pdfinfo/PdfInfoPdfBoxUnitTest.java (100%) rename {pdf-2 => text-processing-libraries-modules/pdf-2}/src/test/resources/input.pdf (100%) rename {pdf => text-processing-libraries-modules/pdf}/.gitignore (100%) rename {pdf => text-processing-libraries-modules/pdf}/README.md (100%) rename {pdf => text-processing-libraries-modules/pdf}/input.docx (100%) rename {pdf => text-processing-libraries-modules/pdf}/output.pdf (100%) rename {pdf => text-processing-libraries-modules/pdf}/pom.xml (98%) rename {pdf => text-processing-libraries-modules/pdf}/sample.pdf (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/java/com/baeldung/pdf/DocxToPDFExample.java (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/java/com/baeldung/pdf/PDF2HTMLExample.java (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/java/com/baeldung/pdf/PDF2ImageExample.java (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/java/com/baeldung/pdf/PDF2TextExample.java (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/java/com/baeldung/pdf/PDF2WordExample.java (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/java/com/baeldung/pdf/PDFSampleMain.java (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/java/com/baeldung/pdf/openpdf/CustomElementFactoryImpl.java (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/java/com/baeldung/pdf/openpdf/Html2PdfUsingFlyingSaucer.java (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/java/com/baeldung/pdf/openpdf/Html2PdfUsingOpenHtml.java (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/java/com/baeldung/pdfthymeleaf/PDFThymeleafExample.java (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/resources/Java_logo.png (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/resources/html.html (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/resources/html2pdf.pdf (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/resources/htmlforopenpdf.html (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/resources/logback.xml (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/resources/pdf.pdf (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/resources/style.css (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/resources/thymeleaf_template.html (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/main/resources/txt.txt (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/test/java/com/baeldung/pdf/base64/EncodeDecodeUnitTest.java (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/test/java/com/baeldung/pdfreadertest/ReadPdfFileUnitTest.java (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/test/java/com/baeldung/pdfthymeleaf/PDFThymeleafUnitTest.java (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/test/resources/input.pdf (100%) rename {pdf => text-processing-libraries-modules/pdf}/src/test/resources/output.pdf (100%) create mode 100644 text-processing-libraries-modules/pom.xml diff --git a/pom.xml b/pom.xml index e8b8648cf9..69049d5402 100644 --- a/pom.xml +++ b/pom.xml @@ -686,7 +686,6 @@ akka-modules algorithms-modules - antlr apache-cxf-modules apache-httpclient-2 apache-httpclient4 @@ -700,9 +699,7 @@ apache-poi-3 apache-poi apache-thrift - apache-tika apache-velocity - asciidoctor atomix aws-modules azure @@ -813,8 +810,6 @@ osgi parent-boot-3 patterns-modules - pdf-2 - pdf performance-tests persistence-modules @@ -896,6 +891,7 @@ tensorflow-java testing-modules testing-modules/mockito-simple + text-processing-libraries-modules timefold-solver vaadin vavr-modules @@ -940,7 +936,6 @@ akka-modules algorithms-modules - antlr apache-cxf-modules apache-httpclient-2 apache-httpclient4 @@ -954,9 +949,7 @@ apache-poi-3 apache-poi apache-thrift - apache-tika apache-velocity - asciidoctor atomix aws-modules azure @@ -1067,8 +1060,6 @@ osgi parent-boot-3 patterns-modules - pdf-2 - pdf performance-tests persistence-modules persistence-modules/spring-data-neo4j @@ -1148,6 +1139,7 @@ tensorflow-java testing-modules testing-modules/mockito-simple + text-processing-libraries-modules timefold-solver vaadin vavr-modules diff --git a/text-processing-libraries-modules/README.md b/text-processing-libraries-modules/README.md new file mode 100644 index 0000000000..1b21f540a3 --- /dev/null +++ b/text-processing-libraries-modules/README.md @@ -0,0 +1,3 @@ +## Text Processing Libraries + +This module contains modules about Text Processing Libraries. \ No newline at end of file diff --git a/antlr/README.md b/text-processing-libraries-modules/antlr/README.md similarity index 100% rename from antlr/README.md rename to text-processing-libraries-modules/antlr/README.md diff --git a/antlr/pom.xml b/text-processing-libraries-modules/antlr/pom.xml similarity index 96% rename from antlr/pom.xml rename to text-processing-libraries-modules/antlr/pom.xml index f9d6fb1a08..a7cf39eb44 100644 --- a/antlr/pom.xml +++ b/text-processing-libraries-modules/antlr/pom.xml @@ -8,7 +8,7 @@ com.baeldung - parent-modules + text-processing-libraries-modules 1.0.0-SNAPSHOT diff --git a/antlr/src/main/antlr4/com/baeldung/antlr/Java8.g4 b/text-processing-libraries-modules/antlr/src/main/antlr4/com/baeldung/antlr/Java8.g4 similarity index 100% rename from antlr/src/main/antlr4/com/baeldung/antlr/Java8.g4 rename to text-processing-libraries-modules/antlr/src/main/antlr4/com/baeldung/antlr/Java8.g4 diff --git a/antlr/src/main/antlr4/com/baeldung/antlr/Log.g4 b/text-processing-libraries-modules/antlr/src/main/antlr4/com/baeldung/antlr/Log.g4 similarity index 100% rename from antlr/src/main/antlr4/com/baeldung/antlr/Log.g4 rename to text-processing-libraries-modules/antlr/src/main/antlr4/com/baeldung/antlr/Log.g4 diff --git a/antlr/src/main/java/com/baeldung/antlr/java/UppercaseMethodListener.java b/text-processing-libraries-modules/antlr/src/main/java/com/baeldung/antlr/java/UppercaseMethodListener.java similarity index 100% rename from antlr/src/main/java/com/baeldung/antlr/java/UppercaseMethodListener.java rename to text-processing-libraries-modules/antlr/src/main/java/com/baeldung/antlr/java/UppercaseMethodListener.java diff --git a/antlr/src/main/java/com/baeldung/antlr/log/LogListener.java b/text-processing-libraries-modules/antlr/src/main/java/com/baeldung/antlr/log/LogListener.java similarity index 100% rename from antlr/src/main/java/com/baeldung/antlr/log/LogListener.java rename to text-processing-libraries-modules/antlr/src/main/java/com/baeldung/antlr/log/LogListener.java diff --git a/antlr/src/main/java/com/baeldung/antlr/log/model/LogEntry.java b/text-processing-libraries-modules/antlr/src/main/java/com/baeldung/antlr/log/model/LogEntry.java similarity index 100% rename from antlr/src/main/java/com/baeldung/antlr/log/model/LogEntry.java rename to text-processing-libraries-modules/antlr/src/main/java/com/baeldung/antlr/log/model/LogEntry.java diff --git a/antlr/src/main/java/com/baeldung/antlr/log/model/LogLevel.java b/text-processing-libraries-modules/antlr/src/main/java/com/baeldung/antlr/log/model/LogLevel.java similarity index 100% rename from antlr/src/main/java/com/baeldung/antlr/log/model/LogLevel.java rename to text-processing-libraries-modules/antlr/src/main/java/com/baeldung/antlr/log/model/LogLevel.java diff --git a/antlr/src/main/resources/logback.xml b/text-processing-libraries-modules/antlr/src/main/resources/logback.xml similarity index 100% rename from antlr/src/main/resources/logback.xml rename to text-processing-libraries-modules/antlr/src/main/resources/logback.xml diff --git a/antlr/src/test/java/com/baeldung/antlr/JavaParserUnitTest.java b/text-processing-libraries-modules/antlr/src/test/java/com/baeldung/antlr/JavaParserUnitTest.java similarity index 100% rename from antlr/src/test/java/com/baeldung/antlr/JavaParserUnitTest.java rename to text-processing-libraries-modules/antlr/src/test/java/com/baeldung/antlr/JavaParserUnitTest.java diff --git a/antlr/src/test/java/com/baeldung/antlr/LogParserUnitTest.java b/text-processing-libraries-modules/antlr/src/test/java/com/baeldung/antlr/LogParserUnitTest.java similarity index 100% rename from antlr/src/test/java/com/baeldung/antlr/LogParserUnitTest.java rename to text-processing-libraries-modules/antlr/src/test/java/com/baeldung/antlr/LogParserUnitTest.java diff --git a/apache-tika/README.md b/text-processing-libraries-modules/apache-tika/README.md similarity index 100% rename from apache-tika/README.md rename to text-processing-libraries-modules/apache-tika/README.md diff --git a/apache-tika/pom.xml b/text-processing-libraries-modules/apache-tika/pom.xml similarity index 92% rename from apache-tika/pom.xml rename to text-processing-libraries-modules/apache-tika/pom.xml index 896b88ec4b..f48fe34e25 100644 --- a/apache-tika/pom.xml +++ b/text-processing-libraries-modules/apache-tika/pom.xml @@ -9,7 +9,7 @@ com.baeldung - parent-modules + text-processing-libraries-modules 1.0.0-SNAPSHOT diff --git a/apache-tika/src/main/java/com/baeldung/tika/TikaAnalysis.java b/text-processing-libraries-modules/apache-tika/src/main/java/com/baeldung/tika/TikaAnalysis.java similarity index 100% rename from apache-tika/src/main/java/com/baeldung/tika/TikaAnalysis.java rename to text-processing-libraries-modules/apache-tika/src/main/java/com/baeldung/tika/TikaAnalysis.java diff --git a/apache-tika/src/main/resources/logback.xml b/text-processing-libraries-modules/apache-tika/src/main/resources/logback.xml similarity index 100% rename from apache-tika/src/main/resources/logback.xml rename to text-processing-libraries-modules/apache-tika/src/main/resources/logback.xml diff --git a/apache-tika/src/test/java/com/baeldung/tika/TikaUnitTest.java b/text-processing-libraries-modules/apache-tika/src/test/java/com/baeldung/tika/TikaUnitTest.java similarity index 100% rename from apache-tika/src/test/java/com/baeldung/tika/TikaUnitTest.java rename to text-processing-libraries-modules/apache-tika/src/test/java/com/baeldung/tika/TikaUnitTest.java diff --git a/apache-tika/src/test/resources/tika.docx b/text-processing-libraries-modules/apache-tika/src/test/resources/tika.docx similarity index 100% rename from apache-tika/src/test/resources/tika.docx rename to text-processing-libraries-modules/apache-tika/src/test/resources/tika.docx diff --git a/apache-tika/src/test/resources/tika.txt b/text-processing-libraries-modules/apache-tika/src/test/resources/tika.txt similarity index 100% rename from apache-tika/src/test/resources/tika.txt rename to text-processing-libraries-modules/apache-tika/src/test/resources/tika.txt diff --git a/apache-tika/src/test/resources/tika.xlsx b/text-processing-libraries-modules/apache-tika/src/test/resources/tika.xlsx similarity index 100% rename from apache-tika/src/test/resources/tika.xlsx rename to text-processing-libraries-modules/apache-tika/src/test/resources/tika.xlsx diff --git a/asciidoctor/README.md b/text-processing-libraries-modules/asciidoctor/README.md similarity index 100% rename from asciidoctor/README.md rename to text-processing-libraries-modules/asciidoctor/README.md diff --git a/asciidoctor/log4j.properties b/text-processing-libraries-modules/asciidoctor/log4j.properties similarity index 100% rename from asciidoctor/log4j.properties rename to text-processing-libraries-modules/asciidoctor/log4j.properties diff --git a/asciidoctor/pom.xml b/text-processing-libraries-modules/asciidoctor/pom.xml similarity index 97% rename from asciidoctor/pom.xml rename to text-processing-libraries-modules/asciidoctor/pom.xml index b72f050379..2ebe9d2f0d 100644 --- a/asciidoctor/pom.xml +++ b/text-processing-libraries-modules/asciidoctor/pom.xml @@ -8,7 +8,7 @@ com.baeldung - parent-modules + text-processing-libraries-modules 1.0.0-SNAPSHOT diff --git a/asciidoctor/src/docs/asciidoc/test.adoc b/text-processing-libraries-modules/asciidoctor/src/docs/asciidoc/test.adoc similarity index 100% rename from asciidoctor/src/docs/asciidoc/test.adoc rename to text-processing-libraries-modules/asciidoctor/src/docs/asciidoc/test.adoc diff --git a/asciidoctor/src/main/java/com/baeldung/asciidoctor/AsciidoctorDemo.java b/text-processing-libraries-modules/asciidoctor/src/main/java/com/baeldung/asciidoctor/AsciidoctorDemo.java similarity index 100% rename from asciidoctor/src/main/java/com/baeldung/asciidoctor/AsciidoctorDemo.java rename to text-processing-libraries-modules/asciidoctor/src/main/java/com/baeldung/asciidoctor/AsciidoctorDemo.java diff --git a/asciidoctor/src/main/resources/logback.xml b/text-processing-libraries-modules/asciidoctor/src/main/resources/logback.xml similarity index 100% rename from asciidoctor/src/main/resources/logback.xml rename to text-processing-libraries-modules/asciidoctor/src/main/resources/logback.xml diff --git a/asciidoctor/src/test/java/com/baeldung/asciidoctor/AsciidoctorDemoIntegrationTest.java b/text-processing-libraries-modules/asciidoctor/src/test/java/com/baeldung/asciidoctor/AsciidoctorDemoIntegrationTest.java similarity index 100% rename from asciidoctor/src/test/java/com/baeldung/asciidoctor/AsciidoctorDemoIntegrationTest.java rename to text-processing-libraries-modules/asciidoctor/src/test/java/com/baeldung/asciidoctor/AsciidoctorDemoIntegrationTest.java diff --git a/asciidoctor/src/themes/custom-theme.yml b/text-processing-libraries-modules/asciidoctor/src/themes/custom-theme.yml similarity index 100% rename from asciidoctor/src/themes/custom-theme.yml rename to text-processing-libraries-modules/asciidoctor/src/themes/custom-theme.yml diff --git a/pdf-2/README.md b/text-processing-libraries-modules/pdf-2/README.md similarity index 100% rename from pdf-2/README.md rename to text-processing-libraries-modules/pdf-2/README.md diff --git a/pdf-2/pom.xml b/text-processing-libraries-modules/pdf-2/pom.xml similarity index 97% rename from pdf-2/pom.xml rename to text-processing-libraries-modules/pdf-2/pom.xml index 430cacbfca..9058e5e634 100644 --- a/pdf-2/pom.xml +++ b/text-processing-libraries-modules/pdf-2/pom.xml @@ -9,7 +9,7 @@ com.baeldung - parent-modules + text-processing-libraries-modules 1.0.0-SNAPSHOT diff --git a/pdf-2/src/main/java/com/baeldung/exceltopdf/ExcelToPDFConverter.java b/text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/exceltopdf/ExcelToPDFConverter.java similarity index 100% rename from pdf-2/src/main/java/com/baeldung/exceltopdf/ExcelToPDFConverter.java rename to text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/exceltopdf/ExcelToPDFConverter.java diff --git a/pdf-2/src/main/java/com/baeldung/pdfedition/PdfContentRemover.java b/text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/pdfedition/PdfContentRemover.java similarity index 97% rename from pdf-2/src/main/java/com/baeldung/pdfedition/PdfContentRemover.java rename to text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/pdfedition/PdfContentRemover.java index 62ccdcb51f..36fc498b6b 100644 --- a/pdf-2/src/main/java/com/baeldung/pdfedition/PdfContentRemover.java +++ b/text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/pdfedition/PdfContentRemover.java @@ -1,43 +1,43 @@ -package com.baeldung.pdfedition; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; - -import com.itextpdf.kernel.geom.Rectangle; -import com.itextpdf.kernel.pdf.PdfDocument; -import com.itextpdf.kernel.pdf.PdfReader; -import com.itextpdf.kernel.pdf.PdfWriter; -import com.itextpdf.pdfcleanup.CleanUpProperties; -import com.itextpdf.pdfcleanup.PdfCleanUpLocation; -import com.itextpdf.pdfcleanup.PdfCleanUpTool; -import com.itextpdf.pdfcleanup.PdfCleaner; -import com.itextpdf.pdfcleanup.autosweep.CompositeCleanupStrategy; -import com.itextpdf.pdfcleanup.autosweep.RegexBasedCleanupStrategy; - -public class PdfContentRemover { - - private static final String SOURCE = "src/main/resources/baeldung-modified.pdf"; - private static final String DESTINATION = "src/main/resources/baeldung-cleaned.pdf"; - - public static void main(String[] args) throws IOException { - PdfReader reader = new PdfReader(SOURCE); - PdfWriter writer = new PdfWriter(DESTINATION); - PdfDocument pdfDocument = new PdfDocument(reader, writer); - removeContentFromDocument(pdfDocument); - pdfDocument.close(); - } - - private static void removeContentFromDocument(PdfDocument pdfDocument) throws IOException { - // 5.1. remove text - CompositeCleanupStrategy strategy = new CompositeCleanupStrategy(); - strategy.add(new RegexBasedCleanupStrategy("Baeldung")); - PdfCleaner.autoSweepCleanUp(pdfDocument, strategy); - - // 5.2. remove other areas - List cleanUpLocations = Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(10, 50, 90, 70)), new PdfCleanUpLocation(2, new Rectangle(35, 400, 100, 35))); - PdfCleanUpTool cleaner = new PdfCleanUpTool(pdfDocument, cleanUpLocations, new CleanUpProperties()); - cleaner.cleanUp(); - } - -} +package com.baeldung.pdfedition; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +import com.itextpdf.kernel.geom.Rectangle; +import com.itextpdf.kernel.pdf.PdfDocument; +import com.itextpdf.kernel.pdf.PdfReader; +import com.itextpdf.kernel.pdf.PdfWriter; +import com.itextpdf.pdfcleanup.CleanUpProperties; +import com.itextpdf.pdfcleanup.PdfCleanUpLocation; +import com.itextpdf.pdfcleanup.PdfCleanUpTool; +import com.itextpdf.pdfcleanup.PdfCleaner; +import com.itextpdf.pdfcleanup.autosweep.CompositeCleanupStrategy; +import com.itextpdf.pdfcleanup.autosweep.RegexBasedCleanupStrategy; + +public class PdfContentRemover { + + private static final String SOURCE = "src/main/resources/baeldung-modified.pdf"; + private static final String DESTINATION = "src/main/resources/baeldung-cleaned.pdf"; + + public static void main(String[] args) throws IOException { + PdfReader reader = new PdfReader(SOURCE); + PdfWriter writer = new PdfWriter(DESTINATION); + PdfDocument pdfDocument = new PdfDocument(reader, writer); + removeContentFromDocument(pdfDocument); + pdfDocument.close(); + } + + private static void removeContentFromDocument(PdfDocument pdfDocument) throws IOException { + // 5.1. remove text + CompositeCleanupStrategy strategy = new CompositeCleanupStrategy(); + strategy.add(new RegexBasedCleanupStrategy("Baeldung")); + PdfCleaner.autoSweepCleanUp(pdfDocument, strategy); + + // 5.2. remove other areas + List cleanUpLocations = Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(10, 50, 90, 70)), new PdfCleanUpLocation(2, new Rectangle(35, 400, 100, 35))); + PdfCleanUpTool cleaner = new PdfCleanUpTool(pdfDocument, cleanUpLocations, new CleanUpProperties()); + cleaner.cleanUp(); + } + +} diff --git a/pdf-2/src/main/java/com/baeldung/pdfedition/PdfEditor.java b/text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/pdfedition/PdfEditor.java similarity index 97% rename from pdf-2/src/main/java/com/baeldung/pdfedition/PdfEditor.java rename to text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/pdfedition/PdfEditor.java index cfdf5917b8..94bf6ae0d6 100644 --- a/pdf-2/src/main/java/com/baeldung/pdfedition/PdfEditor.java +++ b/text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/pdfedition/PdfEditor.java @@ -1,86 +1,86 @@ -package com.baeldung.pdfedition; - -import java.io.IOException; -import java.net.MalformedURLException; - -import com.itextpdf.forms.PdfAcroForm; -import com.itextpdf.forms.fields.PdfFormField; -import com.itextpdf.forms.fields.PdfTextFormField; -import com.itextpdf.io.image.ImageData; -import com.itextpdf.io.image.ImageDataFactory; -import com.itextpdf.kernel.geom.Rectangle; -import com.itextpdf.kernel.pdf.PdfDocument; -import com.itextpdf.kernel.pdf.PdfReader; -import com.itextpdf.kernel.pdf.PdfString; -import com.itextpdf.kernel.pdf.PdfWriter; -import com.itextpdf.kernel.pdf.annot.PdfAnnotation; -import com.itextpdf.kernel.pdf.annot.PdfTextAnnotation; -import com.itextpdf.layout.Document; -import com.itextpdf.layout.element.Image; -import com.itextpdf.layout.element.Paragraph; -import com.itextpdf.layout.element.Table; -import com.itextpdf.layout.element.Text; -import com.itextpdf.layout.properties.UnitValue; - -public class PdfEditor { - - private static final String SOURCE = "src/main/resources/baeldung.pdf"; - private static final String DESTINATION = "src/main/resources/baeldung-modified.pdf"; - - public static void main(String[] args) throws IOException { - PdfReader reader = new PdfReader(SOURCE); - PdfWriter writer = new PdfWriter(DESTINATION); - PdfDocument pdfDocument = new PdfDocument(reader, writer); - addContentToDocument(pdfDocument); - } - - private static void addContentToDocument(PdfDocument pdfDocument) throws MalformedURLException { - // 4.1. add form - PdfFormField personal = PdfFormField.createEmptyField(pdfDocument); - personal.setFieldName("information"); - PdfTextFormField name = PdfFormField.createText(pdfDocument, new Rectangle(35, 400, 100, 30), "name", ""); - personal.addKid(name); - PdfAcroForm.getAcroForm(pdfDocument, true) - .addField(personal, pdfDocument.getFirstPage()); - - // 4.2. add new page - pdfDocument.addNewPage(1); - - // 4.3. add annotation - PdfAnnotation ann = new PdfTextAnnotation(new Rectangle(40, 435, 0, 0)).setTitle(new PdfString("name")) - .setContents("Your name"); - pdfDocument.getPage(2) - .addAnnotation(ann); - - // create document form pdf document - Document document = new Document(pdfDocument); - - // 4.4. add an image - ImageData imageData = ImageDataFactory.create("src/main/resources/baeldung.png"); - Image image = new Image(imageData).scaleAbsolute(550, 100) - .setFixedPosition(1, 10, 50); - document.add(image); - - // 4.5. add a paragraph - Text title = new Text("This is a demo").setFontSize(16); - Text author = new Text("Baeldung tutorials."); - Paragraph p = new Paragraph().setFontSize(8) - .add(title) - .add(" from ") - .add(author); - document.add(p); - - // 4.6. add a table - Table table = new Table(UnitValue.createPercentArray(2)); - table.addHeaderCell("#"); - table.addHeaderCell("company"); - table.addCell("name"); - table.addCell("baeldung"); - document.add(table); - - // close the document - // this automatically closes the pdfDocument, which then closes automatically the pdfReader and pdfWriter - document.close(); - } - -} +package com.baeldung.pdfedition; + +import java.io.IOException; +import java.net.MalformedURLException; + +import com.itextpdf.forms.PdfAcroForm; +import com.itextpdf.forms.fields.PdfFormField; +import com.itextpdf.forms.fields.PdfTextFormField; +import com.itextpdf.io.image.ImageData; +import com.itextpdf.io.image.ImageDataFactory; +import com.itextpdf.kernel.geom.Rectangle; +import com.itextpdf.kernel.pdf.PdfDocument; +import com.itextpdf.kernel.pdf.PdfReader; +import com.itextpdf.kernel.pdf.PdfString; +import com.itextpdf.kernel.pdf.PdfWriter; +import com.itextpdf.kernel.pdf.annot.PdfAnnotation; +import com.itextpdf.kernel.pdf.annot.PdfTextAnnotation; +import com.itextpdf.layout.Document; +import com.itextpdf.layout.element.Image; +import com.itextpdf.layout.element.Paragraph; +import com.itextpdf.layout.element.Table; +import com.itextpdf.layout.element.Text; +import com.itextpdf.layout.properties.UnitValue; + +public class PdfEditor { + + private static final String SOURCE = "src/main/resources/baeldung.pdf"; + private static final String DESTINATION = "src/main/resources/baeldung-modified.pdf"; + + public static void main(String[] args) throws IOException { + PdfReader reader = new PdfReader(SOURCE); + PdfWriter writer = new PdfWriter(DESTINATION); + PdfDocument pdfDocument = new PdfDocument(reader, writer); + addContentToDocument(pdfDocument); + } + + private static void addContentToDocument(PdfDocument pdfDocument) throws MalformedURLException { + // 4.1. add form + PdfFormField personal = PdfFormField.createEmptyField(pdfDocument); + personal.setFieldName("information"); + PdfTextFormField name = PdfFormField.createText(pdfDocument, new Rectangle(35, 400, 100, 30), "name", ""); + personal.addKid(name); + PdfAcroForm.getAcroForm(pdfDocument, true) + .addField(personal, pdfDocument.getFirstPage()); + + // 4.2. add new page + pdfDocument.addNewPage(1); + + // 4.3. add annotation + PdfAnnotation ann = new PdfTextAnnotation(new Rectangle(40, 435, 0, 0)).setTitle(new PdfString("name")) + .setContents("Your name"); + pdfDocument.getPage(2) + .addAnnotation(ann); + + // create document form pdf document + Document document = new Document(pdfDocument); + + // 4.4. add an image + ImageData imageData = ImageDataFactory.create("src/main/resources/baeldung.png"); + Image image = new Image(imageData).scaleAbsolute(550, 100) + .setFixedPosition(1, 10, 50); + document.add(image); + + // 4.5. add a paragraph + Text title = new Text("This is a demo").setFontSize(16); + Text author = new Text("Baeldung tutorials."); + Paragraph p = new Paragraph().setFontSize(8) + .add(title) + .add(" from ") + .add(author); + document.add(p); + + // 4.6. add a table + Table table = new Table(UnitValue.createPercentArray(2)); + table.addHeaderCell("#"); + table.addHeaderCell("company"); + table.addCell("name"); + table.addCell("baeldung"); + document.add(table); + + // close the document + // this automatically closes the pdfDocument, which then closes automatically the pdfReader and pdfWriter + document.close(); + } + +} diff --git a/pdf-2/src/main/java/com/baeldung/pdfedition/PdfTextReplacement.java b/text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/pdfedition/PdfTextReplacement.java similarity index 97% rename from pdf-2/src/main/java/com/baeldung/pdfedition/PdfTextReplacement.java rename to text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/pdfedition/PdfTextReplacement.java index e81adff1ec..a1ca449134 100644 --- a/pdf-2/src/main/java/com/baeldung/pdfedition/PdfTextReplacement.java +++ b/text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/pdfedition/PdfTextReplacement.java @@ -1,45 +1,45 @@ -package com.baeldung.pdfedition; - -import java.io.IOException; - -import com.itextpdf.kernel.colors.ColorConstants; -import com.itextpdf.kernel.pdf.PdfDocument; -import com.itextpdf.kernel.pdf.PdfPage; -import com.itextpdf.kernel.pdf.PdfReader; -import com.itextpdf.kernel.pdf.PdfWriter; -import com.itextpdf.kernel.pdf.canvas.PdfCanvas; -import com.itextpdf.kernel.pdf.canvas.parser.listener.IPdfTextLocation; -import com.itextpdf.layout.Canvas; -import com.itextpdf.layout.element.Paragraph; -import com.itextpdf.pdfcleanup.PdfCleaner; -import com.itextpdf.pdfcleanup.autosweep.CompositeCleanupStrategy; -import com.itextpdf.pdfcleanup.autosweep.RegexBasedCleanupStrategy; - -public class PdfTextReplacement { - - private static final String SOURCE = "src/main/resources/baeldung-modified.pdf"; - private static final String DESTINATION = "src/main/resources/baeldung-fixed.pdf"; - - public static void main(String[] args) throws IOException { - PdfReader reader = new PdfReader(SOURCE); - PdfWriter writer = new PdfWriter(DESTINATION); - PdfDocument pdfDocument = new PdfDocument(reader, writer); - replaceTextContentFromDocument(pdfDocument); - pdfDocument.close(); - } - - private static void replaceTextContentFromDocument(PdfDocument pdfDocument) throws IOException { - CompositeCleanupStrategy strategy = new CompositeCleanupStrategy(); - strategy.add(new RegexBasedCleanupStrategy("Baeldung tutorials").setRedactionColor(ColorConstants.WHITE)); - PdfCleaner.autoSweepCleanUp(pdfDocument, strategy); - - for (IPdfTextLocation location : strategy.getResultantLocations()) { - PdfPage page = pdfDocument.getPage(location.getPageNumber() + 1); - PdfCanvas pdfCanvas = new PdfCanvas(page.newContentStreamAfter(), page.getResources(), page.getDocument()); - Canvas canvas = new Canvas(pdfCanvas, location.getRectangle()); - canvas.add(new Paragraph("HIDDEN").setFontSize(8) - .setMarginTop(0f)); - } - } - -} +package com.baeldung.pdfedition; + +import java.io.IOException; + +import com.itextpdf.kernel.colors.ColorConstants; +import com.itextpdf.kernel.pdf.PdfDocument; +import com.itextpdf.kernel.pdf.PdfPage; +import com.itextpdf.kernel.pdf.PdfReader; +import com.itextpdf.kernel.pdf.PdfWriter; +import com.itextpdf.kernel.pdf.canvas.PdfCanvas; +import com.itextpdf.kernel.pdf.canvas.parser.listener.IPdfTextLocation; +import com.itextpdf.layout.Canvas; +import com.itextpdf.layout.element.Paragraph; +import com.itextpdf.pdfcleanup.PdfCleaner; +import com.itextpdf.pdfcleanup.autosweep.CompositeCleanupStrategy; +import com.itextpdf.pdfcleanup.autosweep.RegexBasedCleanupStrategy; + +public class PdfTextReplacement { + + private static final String SOURCE = "src/main/resources/baeldung-modified.pdf"; + private static final String DESTINATION = "src/main/resources/baeldung-fixed.pdf"; + + public static void main(String[] args) throws IOException { + PdfReader reader = new PdfReader(SOURCE); + PdfWriter writer = new PdfWriter(DESTINATION); + PdfDocument pdfDocument = new PdfDocument(reader, writer); + replaceTextContentFromDocument(pdfDocument); + pdfDocument.close(); + } + + private static void replaceTextContentFromDocument(PdfDocument pdfDocument) throws IOException { + CompositeCleanupStrategy strategy = new CompositeCleanupStrategy(); + strategy.add(new RegexBasedCleanupStrategy("Baeldung tutorials").setRedactionColor(ColorConstants.WHITE)); + PdfCleaner.autoSweepCleanUp(pdfDocument, strategy); + + for (IPdfTextLocation location : strategy.getResultantLocations()) { + PdfPage page = pdfDocument.getPage(location.getPageNumber() + 1); + PdfCanvas pdfCanvas = new PdfCanvas(page.newContentStreamAfter(), page.getResources(), page.getDocument()); + Canvas canvas = new Canvas(pdfCanvas, location.getRectangle()); + canvas.add(new Paragraph("HIDDEN").setFontSize(8) + .setMarginTop(0f)); + } + } + +} diff --git a/pdf-2/src/main/java/com/baeldung/pdfinfo/PdfInfoIText.java b/text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/pdfinfo/PdfInfoIText.java similarity index 100% rename from pdf-2/src/main/java/com/baeldung/pdfinfo/PdfInfoIText.java rename to text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/pdfinfo/PdfInfoIText.java diff --git a/pdf-2/src/main/java/com/baeldung/pdfinfo/PdfInfoPdfBox.java b/text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/pdfinfo/PdfInfoPdfBox.java similarity index 100% rename from pdf-2/src/main/java/com/baeldung/pdfinfo/PdfInfoPdfBox.java rename to text-processing-libraries-modules/pdf-2/src/main/java/com/baeldung/pdfinfo/PdfInfoPdfBox.java diff --git a/pdf-2/src/main/resources/baeldung-cleaned.pdf b/text-processing-libraries-modules/pdf-2/src/main/resources/baeldung-cleaned.pdf similarity index 100% rename from pdf-2/src/main/resources/baeldung-cleaned.pdf rename to text-processing-libraries-modules/pdf-2/src/main/resources/baeldung-cleaned.pdf diff --git a/pdf-2/src/main/resources/baeldung-fixed.pdf b/text-processing-libraries-modules/pdf-2/src/main/resources/baeldung-fixed.pdf similarity index 100% rename from pdf-2/src/main/resources/baeldung-fixed.pdf rename to text-processing-libraries-modules/pdf-2/src/main/resources/baeldung-fixed.pdf diff --git a/pdf-2/src/main/resources/baeldung-modified.pdf b/text-processing-libraries-modules/pdf-2/src/main/resources/baeldung-modified.pdf similarity index 100% rename from pdf-2/src/main/resources/baeldung-modified.pdf rename to text-processing-libraries-modules/pdf-2/src/main/resources/baeldung-modified.pdf diff --git a/pdf-2/src/main/resources/baeldung.pdf b/text-processing-libraries-modules/pdf-2/src/main/resources/baeldung.pdf similarity index 100% rename from pdf-2/src/main/resources/baeldung.pdf rename to text-processing-libraries-modules/pdf-2/src/main/resources/baeldung.pdf diff --git a/pdf-2/src/main/resources/baeldung.png b/text-processing-libraries-modules/pdf-2/src/main/resources/baeldung.png similarity index 100% rename from pdf-2/src/main/resources/baeldung.png rename to text-processing-libraries-modules/pdf-2/src/main/resources/baeldung.png diff --git a/pdf-2/src/main/resources/excelsample.xlsx b/text-processing-libraries-modules/pdf-2/src/main/resources/excelsample.xlsx similarity index 100% rename from pdf-2/src/main/resources/excelsample.xlsx rename to text-processing-libraries-modules/pdf-2/src/main/resources/excelsample.xlsx diff --git a/pdf-2/src/main/resources/pdfsample.pdf b/text-processing-libraries-modules/pdf-2/src/main/resources/pdfsample.pdf similarity index 100% rename from pdf-2/src/main/resources/pdfsample.pdf rename to text-processing-libraries-modules/pdf-2/src/main/resources/pdfsample.pdf diff --git a/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoITextUnitTest.java b/text-processing-libraries-modules/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoITextUnitTest.java similarity index 100% rename from pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoITextUnitTest.java rename to text-processing-libraries-modules/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoITextUnitTest.java diff --git a/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoPdfBoxUnitTest.java b/text-processing-libraries-modules/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoPdfBoxUnitTest.java similarity index 100% rename from pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoPdfBoxUnitTest.java rename to text-processing-libraries-modules/pdf-2/src/test/java/com/baeldung/pdfinfo/PdfInfoPdfBoxUnitTest.java diff --git a/pdf-2/src/test/resources/input.pdf b/text-processing-libraries-modules/pdf-2/src/test/resources/input.pdf similarity index 100% rename from pdf-2/src/test/resources/input.pdf rename to text-processing-libraries-modules/pdf-2/src/test/resources/input.pdf diff --git a/pdf/.gitignore b/text-processing-libraries-modules/pdf/.gitignore similarity index 100% rename from pdf/.gitignore rename to text-processing-libraries-modules/pdf/.gitignore diff --git a/pdf/README.md b/text-processing-libraries-modules/pdf/README.md similarity index 100% rename from pdf/README.md rename to text-processing-libraries-modules/pdf/README.md diff --git a/pdf/input.docx b/text-processing-libraries-modules/pdf/input.docx similarity index 100% rename from pdf/input.docx rename to text-processing-libraries-modules/pdf/input.docx diff --git a/pdf/output.pdf b/text-processing-libraries-modules/pdf/output.pdf similarity index 100% rename from pdf/output.pdf rename to text-processing-libraries-modules/pdf/output.pdf diff --git a/pdf/pom.xml b/text-processing-libraries-modules/pdf/pom.xml similarity index 98% rename from pdf/pom.xml rename to text-processing-libraries-modules/pdf/pom.xml index 041f356b9a..b5de19f815 100644 --- a/pdf/pom.xml +++ b/text-processing-libraries-modules/pdf/pom.xml @@ -9,7 +9,7 @@ com.baeldung - parent-modules + text-processing-libraries-modules 1.0.0-SNAPSHOT diff --git a/pdf/sample.pdf b/text-processing-libraries-modules/pdf/sample.pdf similarity index 100% rename from pdf/sample.pdf rename to text-processing-libraries-modules/pdf/sample.pdf diff --git a/pdf/src/main/java/com/baeldung/pdf/DocxToPDFExample.java b/text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/DocxToPDFExample.java similarity index 100% rename from pdf/src/main/java/com/baeldung/pdf/DocxToPDFExample.java rename to text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/DocxToPDFExample.java diff --git a/pdf/src/main/java/com/baeldung/pdf/PDF2HTMLExample.java b/text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/PDF2HTMLExample.java similarity index 100% rename from pdf/src/main/java/com/baeldung/pdf/PDF2HTMLExample.java rename to text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/PDF2HTMLExample.java diff --git a/pdf/src/main/java/com/baeldung/pdf/PDF2ImageExample.java b/text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/PDF2ImageExample.java similarity index 100% rename from pdf/src/main/java/com/baeldung/pdf/PDF2ImageExample.java rename to text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/PDF2ImageExample.java diff --git a/pdf/src/main/java/com/baeldung/pdf/PDF2TextExample.java b/text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/PDF2TextExample.java similarity index 100% rename from pdf/src/main/java/com/baeldung/pdf/PDF2TextExample.java rename to text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/PDF2TextExample.java diff --git a/pdf/src/main/java/com/baeldung/pdf/PDF2WordExample.java b/text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/PDF2WordExample.java similarity index 100% rename from pdf/src/main/java/com/baeldung/pdf/PDF2WordExample.java rename to text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/PDF2WordExample.java diff --git a/pdf/src/main/java/com/baeldung/pdf/PDFSampleMain.java b/text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/PDFSampleMain.java similarity index 100% rename from pdf/src/main/java/com/baeldung/pdf/PDFSampleMain.java rename to text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/PDFSampleMain.java diff --git a/pdf/src/main/java/com/baeldung/pdf/openpdf/CustomElementFactoryImpl.java b/text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/openpdf/CustomElementFactoryImpl.java similarity index 100% rename from pdf/src/main/java/com/baeldung/pdf/openpdf/CustomElementFactoryImpl.java rename to text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/openpdf/CustomElementFactoryImpl.java diff --git a/pdf/src/main/java/com/baeldung/pdf/openpdf/Html2PdfUsingFlyingSaucer.java b/text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/openpdf/Html2PdfUsingFlyingSaucer.java similarity index 100% rename from pdf/src/main/java/com/baeldung/pdf/openpdf/Html2PdfUsingFlyingSaucer.java rename to text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/openpdf/Html2PdfUsingFlyingSaucer.java diff --git a/pdf/src/main/java/com/baeldung/pdf/openpdf/Html2PdfUsingOpenHtml.java b/text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/openpdf/Html2PdfUsingOpenHtml.java similarity index 100% rename from pdf/src/main/java/com/baeldung/pdf/openpdf/Html2PdfUsingOpenHtml.java rename to text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdf/openpdf/Html2PdfUsingOpenHtml.java diff --git a/pdf/src/main/java/com/baeldung/pdfthymeleaf/PDFThymeleafExample.java b/text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdfthymeleaf/PDFThymeleafExample.java similarity index 100% rename from pdf/src/main/java/com/baeldung/pdfthymeleaf/PDFThymeleafExample.java rename to text-processing-libraries-modules/pdf/src/main/java/com/baeldung/pdfthymeleaf/PDFThymeleafExample.java diff --git a/pdf/src/main/resources/Java_logo.png b/text-processing-libraries-modules/pdf/src/main/resources/Java_logo.png similarity index 100% rename from pdf/src/main/resources/Java_logo.png rename to text-processing-libraries-modules/pdf/src/main/resources/Java_logo.png diff --git a/pdf/src/main/resources/html.html b/text-processing-libraries-modules/pdf/src/main/resources/html.html similarity index 100% rename from pdf/src/main/resources/html.html rename to text-processing-libraries-modules/pdf/src/main/resources/html.html diff --git a/pdf/src/main/resources/html2pdf.pdf b/text-processing-libraries-modules/pdf/src/main/resources/html2pdf.pdf similarity index 100% rename from pdf/src/main/resources/html2pdf.pdf rename to text-processing-libraries-modules/pdf/src/main/resources/html2pdf.pdf diff --git a/pdf/src/main/resources/htmlforopenpdf.html b/text-processing-libraries-modules/pdf/src/main/resources/htmlforopenpdf.html similarity index 100% rename from pdf/src/main/resources/htmlforopenpdf.html rename to text-processing-libraries-modules/pdf/src/main/resources/htmlforopenpdf.html diff --git a/pdf/src/main/resources/logback.xml b/text-processing-libraries-modules/pdf/src/main/resources/logback.xml similarity index 100% rename from pdf/src/main/resources/logback.xml rename to text-processing-libraries-modules/pdf/src/main/resources/logback.xml diff --git a/pdf/src/main/resources/pdf.pdf b/text-processing-libraries-modules/pdf/src/main/resources/pdf.pdf similarity index 100% rename from pdf/src/main/resources/pdf.pdf rename to text-processing-libraries-modules/pdf/src/main/resources/pdf.pdf diff --git a/pdf/src/main/resources/style.css b/text-processing-libraries-modules/pdf/src/main/resources/style.css similarity index 100% rename from pdf/src/main/resources/style.css rename to text-processing-libraries-modules/pdf/src/main/resources/style.css diff --git a/pdf/src/main/resources/thymeleaf_template.html b/text-processing-libraries-modules/pdf/src/main/resources/thymeleaf_template.html similarity index 100% rename from pdf/src/main/resources/thymeleaf_template.html rename to text-processing-libraries-modules/pdf/src/main/resources/thymeleaf_template.html diff --git a/pdf/src/main/resources/txt.txt b/text-processing-libraries-modules/pdf/src/main/resources/txt.txt similarity index 100% rename from pdf/src/main/resources/txt.txt rename to text-processing-libraries-modules/pdf/src/main/resources/txt.txt diff --git a/pdf/src/test/java/com/baeldung/pdf/base64/EncodeDecodeUnitTest.java b/text-processing-libraries-modules/pdf/src/test/java/com/baeldung/pdf/base64/EncodeDecodeUnitTest.java similarity index 100% rename from pdf/src/test/java/com/baeldung/pdf/base64/EncodeDecodeUnitTest.java rename to text-processing-libraries-modules/pdf/src/test/java/com/baeldung/pdf/base64/EncodeDecodeUnitTest.java diff --git a/pdf/src/test/java/com/baeldung/pdfreadertest/ReadPdfFileUnitTest.java b/text-processing-libraries-modules/pdf/src/test/java/com/baeldung/pdfreadertest/ReadPdfFileUnitTest.java similarity index 100% rename from pdf/src/test/java/com/baeldung/pdfreadertest/ReadPdfFileUnitTest.java rename to text-processing-libraries-modules/pdf/src/test/java/com/baeldung/pdfreadertest/ReadPdfFileUnitTest.java diff --git a/pdf/src/test/java/com/baeldung/pdfthymeleaf/PDFThymeleafUnitTest.java b/text-processing-libraries-modules/pdf/src/test/java/com/baeldung/pdfthymeleaf/PDFThymeleafUnitTest.java similarity index 100% rename from pdf/src/test/java/com/baeldung/pdfthymeleaf/PDFThymeleafUnitTest.java rename to text-processing-libraries-modules/pdf/src/test/java/com/baeldung/pdfthymeleaf/PDFThymeleafUnitTest.java diff --git a/pdf/src/test/resources/input.pdf b/text-processing-libraries-modules/pdf/src/test/resources/input.pdf similarity index 100% rename from pdf/src/test/resources/input.pdf rename to text-processing-libraries-modules/pdf/src/test/resources/input.pdf diff --git a/pdf/src/test/resources/output.pdf b/text-processing-libraries-modules/pdf/src/test/resources/output.pdf similarity index 100% rename from pdf/src/test/resources/output.pdf rename to text-processing-libraries-modules/pdf/src/test/resources/output.pdf diff --git a/text-processing-libraries-modules/pom.xml b/text-processing-libraries-modules/pom.xml new file mode 100644 index 0000000000..a7bb3675eb --- /dev/null +++ b/text-processing-libraries-modules/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + text-processing-libraries-modules + text-processing-libraries-modules + pom + + + parent-modules + com.baeldung + 1.0.0-SNAPSHOT + + + + antlr + apache-tika + asciidoctor + pdf + pdf-2 + + + \ No newline at end of file