Skip to content

Commit

Permalink
GH-356 update PrintHelper to implement Printable to allows for print …
Browse files Browse the repository at this point in the history
…jobs that are made up of different Doc types. (#357)
  • Loading branch information
pcorless authored May 28, 2024
1 parent 715db20 commit 8b150f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
import javax.print.*;
import javax.print.attribute.*;
import javax.print.attribute.standard.*;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
Expand All @@ -17,7 +21,7 @@
import java.util.concurrent.FutureTask;
import java.util.regex.Pattern;

public abstract class PrintHelper {
public abstract class PrintHelper implements Printable {

public static final PrintService[] EMPTY_PRINTSERVICE_ARRAY = new PrintService[0];
private static final Pattern END_NEWLINE_PATTERN = Pattern.compile("[\r\n]+$");
Expand Down Expand Up @@ -269,6 +273,8 @@ public void setupPrintService(final PrintService printService,

public abstract void print(PrintJobWatcher printJobWatcher) throws PrintException;

public abstract int print(Graphics graphics, PageFormat pageFormat, int i) throws PrinterException;

/**
* Print a range of pages from the document as specified by #setupPrintService.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*
* @since 2.0
*/
public class PrintHelperImpl extends PrintHelper implements Printable {
public class PrintHelperImpl extends PrintHelper {

private static final Logger logger =
Logger.getLogger(PrintHelperImpl.class.toString());
Expand Down

0 comments on commit 8b150f4

Please sign in to comment.