-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for external version of PD4ML
- Loading branch information
1 parent
0c5bc24
commit f08fc10
Showing
9 changed files
with
182 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#Build Number for ANT. Do not edit! | ||
#Wed Jun 28 15:35:36 CEST 2023 | ||
build.number=21 | ||
#Tue Jul 04 15:21:25 CEST 2023 | ||
build.number=5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
source/java/src/org/lucee/extension/pdf/pd4ml/lib/PDFBy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.lucee.extension.pdf.pd4ml.lib; | ||
|
||
import java.awt.Dimension; | ||
import java.awt.Insets; | ||
import java.awt.image.BufferedImage; | ||
import java.io.InputStreamReader; | ||
import java.io.OutputStream; | ||
import java.net.URL; | ||
|
||
import org.lucee.extension.pdf.PDFPageMark; | ||
|
||
import lucee.runtime.exp.PageException; | ||
|
||
public interface PDFBy { | ||
public PDFBy newInstance() throws PageException; | ||
|
||
public void enableTableBreaks(boolean b) throws PageException; | ||
|
||
public void interpolateImages(boolean b) throws PageException; | ||
|
||
public void adjustHtmlWidth() throws PageException; | ||
|
||
public void setPageInsets(Insets insets) throws PageException; | ||
|
||
public void setPageSize(Dimension dimension) throws PageException; | ||
|
||
public void generateOutlines(boolean flag) throws PageException; | ||
|
||
public void useTTF(String pathToFontDirs, boolean embed) throws PageException; | ||
|
||
public boolean isPro() throws PageException; | ||
|
||
public void overrideDocumentEncoding(String encoding) throws PageException; | ||
|
||
public void setDefaultTTFs(String string, String string2, String string3) throws PageException; | ||
|
||
public void render(InputStreamReader reader, OutputStream os) throws PageException; | ||
|
||
public BufferedImage[] renderAsImages(URL url, int width, int height) throws PageException; | ||
|
||
public void render(String str, OutputStream os, URL base) throws PageException; | ||
|
||
public void setPageHeader(PDFPageMark header) throws PageException; | ||
|
||
public void setPageFooter(PDFPageMark footer) throws PageException; | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
source/java/src/org/lucee/extension/pdf/pd4ml/lib/PDFByFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.lucee.extension.pdf.pd4ml.lib; | ||
|
||
import lucee.commons.io.log.Log; | ||
import lucee.runtime.config.Config; | ||
import lucee.runtime.exp.PageException; | ||
|
||
public class PDFByFactory { | ||
private static Object token = new Object(); | ||
private static PDFBy instance; | ||
|
||
public static PDFBy getInstance(Config config) throws PageException { | ||
if (instance == null) { | ||
synchronized (token) { | ||
if (instance == null) { | ||
Log log = config.getLog("application"); | ||
try { | ||
instance = new PDFByReflection(config); | ||
log.info("PDF", "using PD4ML via reflection from system Classloader"); | ||
} | ||
catch (NoClassDefFoundError err) { | ||
log.error("PDF", err); | ||
instance = new PDFByInnerReflection(config); | ||
log.info("PDF", "using PD4ML via reflection from bundled version"); | ||
} | ||
|
||
} | ||
} | ||
} | ||
return instance.newInstance(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.