Skip to content

Commit

Permalink
(#63) Update README API
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciofx committed Dec 27, 2023
1 parent 1fccdee commit 46a3c39
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,42 +40,32 @@ Here an example how to build a Hello World PDF file using our API:
```java
final File file = new File("HelloWorld.pdf");
final Date date = new Date(2023, 12, 11, 20, 11, 32, "Etc/GMT-3");
final Id id = new Serial();
Files.write(
file.toPath(),
new Document(
id,
new Information(
id,
new MapOf<>(
new MapEntry<>("Title", "Hello World"),
new MapEntry<>("Subject", "PDF document"),
new MapEntry<>("Author", "Fabricio Cabral"),
new MapEntry<>("Creator", "cactoos-pdf"),
new MapEntry<>("Producer", "cactoos-pdf"),
new MapEntry<>("CreationDate", date.asString()),
new MapEntry<>("ModDate", date.asString()),
new MapEntry<>("Keywords", "cactoos pdf elegant objects")
)
"Title", "Hello World",
"Subject", "PDF document",
"Author", "Fabricio Cabral",
"Creator", "cactoos-pdf",
"Producer", "cactoos-pdf",
"CreationDate", date.asString(),
"ModDate", date.asString(),
"Keywords", "cactoos pdf elegant objects"
),
new Catalog(
id,
new DefaultPages(
id,
PageFormat.A4,
new DefaultPage(
id,
new Resources(
new Font(
id,
new FontFamily("Times-Roman", "Type1"),
"F1"
)
),
new Contents(
new FlateEncode(
new Text(
id,
18,
0,
0,
Expand Down

0 comments on commit 46a3c39

Please sign in to comment.