cpdf-source/docsplits/javasplits/c15.tex

39 lines
1.5 KiB
TeX
Raw Permalink Normal View History

2022-04-04 17:06:06 +02:00
/* CHAPTER 14. Fonts. */
2022-04-03 16:48:26 +02:00
2022-04-04 17:06:06 +02:00
/** Retrieves font information. First, call {@link #startGetFontInfo(Pdf)
startGetFontInfo}. Now call {@link #numberFonts() numberFonts} to return
the number of fonts. For each font, call one or more of
{@link #getFontPage(int) getFontPage}, {@link #getFontName(int)
getFontName}, {@link #getFontType(int) getFontType}, and
{@link #getFontEncoding(int) getFontEncoding} giving a serial number
<code>0...n - 1</code> to return information. Finally, call
{@link #endGetFontInfo() endGetFontInfo} to clean up. */
public native void startGetFontInfo(Pdf pdf) throws CpdfError;
2022-04-03 16:48:26 +02:00
2022-04-04 17:06:06 +02:00
public native int numberFonts() throws CpdfError;
2022-04-03 16:48:26 +02:00
2022-04-04 17:06:06 +02:00
public native String getFontName(int serial) throws CpdfError;
2022-04-03 16:48:26 +02:00
2022-04-04 17:06:06 +02:00
public native int getFontPage(int serial) throws CpdfError;
2022-04-03 16:48:26 +02:00
2022-04-04 17:06:06 +02:00
public native String getFontType(int setial) throws CpdfError;
2022-04-03 16:48:26 +02:00
2022-04-04 17:06:06 +02:00
public native String getFontEncoding(int serial) throws CpdfError;
2022-04-03 16:48:26 +02:00
2022-04-04 17:06:06 +02:00
public native void endGetFontInfo() throws CpdfError;
2022-04-03 16:48:26 +02:00
2022-04-04 17:06:06 +02:00
/** Removes all font data from a file. */
public native void removeFonts(Pdf pdf) throws CpdfError;
2022-04-03 16:48:26 +02:00
2022-04-04 17:06:06 +02:00
/** Copies the given font
from the given page in the 'from' PDF to every page in the 'to' PDF. The
new font is stored under its font name.
@param from_pdf PDF document to copy from
@param to_pdf PDF document to copy to
@param range page range
@param pagenumber page number of the page to copy from
@param fontname font name */
public native void copyFont(Pdf from_pdf, Pdf to_pdf, Range range,
int pagenumber, String fontname)
throws CpdfError;