Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/src/main/java/dev/foliopdf/Cell.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ public Cell border(double width, Color color) {
return this;
}

/**
* Provides a hint for the preferred width of this cell in points.
*
* @param pts the preferred width in points
* @return this cell, for chaining
*/
/**
* Sets individual borders on each side of this cell with independent width and color.
*
Expand All @@ -133,6 +127,12 @@ public Cell borders(double topW, Color top, double rightW, Color right,
return this;
}

/**
* Provides a hint for the preferred width of this cell in points.
*
* @param pts the preferred width in points
* @return this cell, for chaining
*/
public Cell widthHint(double pts) {
FolioNative.cellSetWidthHint(handle, pts);
return this;
Expand Down
12 changes: 6 additions & 6 deletions lib/src/main/java/dev/foliopdf/Heading.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ public static Heading ofEmbedded(String text, HeadingLevel level, Font font) {
return new Heading(h);
}

/**
* Sets the text alignment for this heading.
*
* @param align the desired {@link Align} value
* @return this heading, for chaining
*/
/**
* Replaces the heading text with styled runs from a {@link RunList}.
*
Expand All @@ -81,6 +75,12 @@ public Heading setRuns(RunList runs) {
return this;
}

/**
* Sets the text alignment for this heading.
*
* @param align the desired {@link Align} value
* @return this heading, for chaining
*/
public Heading align(Align align) {
FolioNative.headingSetAlign(handle.get(), align.value());
return this;
Expand Down
12 changes: 6 additions & 6 deletions lib/src/main/java/dev/foliopdf/ListElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ public ListElement leading(double leading) {
return this;
}

/**
* Appends a text item to this list.
*
* @param text the item text
* @return this list, for chaining
*/
/**
* Adds a list item with styled text runs from a {@link RunList}.
*
Expand All @@ -122,6 +116,12 @@ public ListElement itemRunsWithSublist(RunList runs) {
return new ListElement(h);
}

/**
* Appends a text item to this list.
*
* @param text the item text
* @return this list, for chaining
*/
public ListElement item(String text) {
FolioNative.listAddItem(handle.get(), text);
return this;
Expand Down
18 changes: 9 additions & 9 deletions lib/src/main/java/dev/foliopdf/Paragraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ public static Paragraph of(String text, Font font, double fontSize) {
return new Paragraph(h);
}

/**
* Creates a paragraph that embeds the font subset in the PDF output.
*
* @param text the paragraph text
* @param font the font to embed
* @param fontSize the font size in points
* @return a new {@link Paragraph} with an embedded font
* @throws FolioException if the native call fails
*/
/**
* Creates a paragraph with the given text and font size using the default Helvetica font.
*
Expand All @@ -68,6 +59,15 @@ public static Paragraph of(String text, double fontSize) {
return of(text, Font.helvetica(), fontSize);
}

/**
* Creates a paragraph that embeds the font subset in the PDF output.
*
* @param text the paragraph text
* @param font the font to embed
* @param fontSize the font size in points
* @return a new {@link Paragraph} with an embedded font
* @throws FolioException if the native call fails
*/
public static Paragraph ofEmbedded(String text, Font font, double fontSize) {
long h = FolioNative.paragraphNewEmbedded(text, font.handle(), fontSize);
if (h == 0) throw new FolioException("Failed to create embedded paragraph: " + FolioNative.lastError());
Expand Down
12 changes: 6 additions & 6 deletions lib/src/main/java/dev/foliopdf/PdfMerger.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,6 @@ public void save(String path) {
FolioNative.mergeSave(handle.get(), path);
}

/**
* Renders the merged document to an in-memory byte array.
*
* @return the PDF bytes
* @throws FolioException if the write fails
*/
/** Returns the number of pages in the merged document. */
public int pageCount() {
return FolioNative.mergePageCount(handle.get());
Expand Down Expand Up @@ -190,6 +184,12 @@ public PdfMerger cropPage(int index, double x1, double y1, double x2, double y2)
return this;
}

/**
* Renders the merged document to an in-memory byte array.
*
* @return the PDF bytes
* @throws FolioException if the write fails
*/
public byte[] writeToBuffer() {
long buf = FolioNative.mergeWriteToBuffer(handle.get());
if (buf == 0) throw new FolioException("Failed to write merged PDF to buffer: " + FolioNative.lastError());
Expand Down
Loading