public final class PdfFileMend extends SaveableFacade
Represents a class for adding texts and images on the pages of existing PDF document.
Constructor and Description |
---|
PdfFileMend()
Constructor.
|
PdfFileMend(IDocument document)
Initializes new
PdfFileMend object on base of the document . |
PdfFileMend(IDocument document,
com.aspose.ms.System.IO.Stream outputStream)
Deprecated.
|
PdfFileMend(IDocument document,
String outputFileName)
Deprecated.
|
PdfFileMend(InputStream inputStream,
OutputStream outputStream)
Deprecated.
|
PdfFileMend(com.aspose.ms.System.IO.Stream inputStream,
com.aspose.ms.System.IO.Stream outputStream)
Deprecated.
|
PdfFileMend(String inputFileName,
String outputFileName)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addImage(InputStream imageStream,
int[] pageNums,
float lowerLeftX,
float lowerLeftY,
float upperRightX,
float upperRightY)
Adds image to the specified pages of PDF document at specified coordinates.
|
boolean |
addImage(InputStream imageStream,
int[] pageNums,
float lowerLeftX,
float lowerLeftY,
float upperRightX,
float upperRightY,
CompositingParameters compositingParameters)
Adds image to the specified pages of PDF document at specified coordinates.
|
boolean |
addImage(InputStream imageStream,
int pageNum,
float lowerLeftX,
float lowerLeftY,
float upperRightX,
float upperRightY)
Adds image to the specified page of PDF document at specified coordinates.
|
boolean |
addImage(InputStream imageStream,
int pageNum,
float lowerLeftX,
float lowerLeftY,
float upperRightX,
float upperRightY,
CompositingParameters compositingParameters)
Adds image to the specified page of PDF document at specified coordinates.
|
boolean |
addImage(String imageName,
int[] pageNums,
float lowerLeftX,
float lowerLeftY,
float upperRightX,
float upperRightY)
Adds image to the specified pages of PDF document at specified coordinates.
|
boolean |
addImage(String imageName,
int[] pageNums,
float lowerLeftX,
float lowerLeftY,
float upperRightX,
float upperRightY,
CompositingParameters compositingParameters)
Adds image to the specified pages of PDF document at specified coordinates.
|
boolean |
addImage(String imageName,
int pageNum,
float lowerLeftX,
float lowerLeftY,
float upperRightX,
float upperRightY)
Adds image to the specified page of PDF document at specified coordinates.
|
boolean |
addImage(String imageName,
int pageNum,
float lowerLeftX,
float lowerLeftY,
float upperRightX,
float upperRightY,
CompositingParameters compositingParameters)
Adds image to the specified page of PDF document at specified coordinates.
|
boolean |
addText(FormattedText text,
Integer[] pageNums,
float lowerLeftX,
float lowerLeftY,
float upperRightX,
float upperRightY)
Not implemented.
|
boolean |
addText(FormattedText text,
int pageNum,
float lowerLeftX,
float lowerLeftY)
Not implemented.
|
boolean |
addText(FormattedText text,
int pageNum,
float lowerLeftX,
float lowerLeftY,
float upperRightX,
float upperRightY)
Not implemented.
|
void |
close()
Closes PdfFileMend object.
|
void |
dispose()
Closes PdfFileMend object.
|
IDocument |
getDocument()
Gets the document
PdfFileMend is working on. |
String |
getInputFile()
Deprecated.
|
InputStream |
getInputStream()
Gets the input stream.
|
String |
getOutputFile()
Deprecated.
|
OutputStream |
getOutputStream()
Deprecated.
|
int |
getTextPositioningMode()
Gets text positioning strategy.
|
int |
getWrapMode()
Gets word wrapping algorithm.
|
void |
save(OutputStream destStream)
Saves the PDF document to the specified file.
|
void |
save(String destFile)
Saves the PDF document to the specified file.
|
void |
setInputFile(String value)
Deprecated.
|
void |
setInputStream(InputStream value)
Sets the input stream.
|
void |
setOutputFile(String value)
Deprecated.
|
void |
setOutputStream(OutputStream value)
Deprecated.
|
void |
setTextPositioningMode(int value)
Sets text positioning strategy.
|
void |
setWordWrap(boolean value)
Sets a bool value that indicates word wrap in AddText methods.
|
void |
setWrapMode(int value)
Sets word wrapping algorithm.
|
bindPdf, bindPdf, bindPdf, bindPdf, bindPdf
public PdfFileMend()
Constructor.
@Deprecated public PdfFileMend(String inputFileName, String outputFileName)
Constructor.
Obsolete("Use constructor without destination.")
inputFileName
- Input PDF file name.outputFileName
- Output PDF file name.@Deprecated public PdfFileMend(InputStream inputStream, OutputStream outputStream)
Constructor. Obsolete("Use constructor without destination.")
inputStream
- Input PDF stream.outputStream
- Output PDF stream.@Deprecated public PdfFileMend(com.aspose.ms.System.IO.Stream inputStream, com.aspose.ms.System.IO.Stream outputStream)
Constructor.
Obsolete("Use constructor without destination.")
inputStream
- Input PDF stream.outputStream
- Output PDF stream.public PdfFileMend(IDocument document)
Initializes new PdfFileMend
object on base of the document
.
document
- Pdf document.@Deprecated public PdfFileMend(IDocument document, String outputFileName)
Initializes new PdfFileMend
object on base of the document
.
Obsolete("Use constructor without destination.")
document
- Pdf document.outputFileName
- Output PDF file name.@Deprecated public PdfFileMend(IDocument document, com.aspose.ms.System.IO.Stream outputStream)
Initializes new PdfFileMend
object on base of the document
.
Obsolete("Use constructor without destination.")
document
- Pdf document.outputStream
- Output PDF stream.public InputStream getInputStream()
Gets the input stream.
public void setInputStream(InputStream value)
Sets the input stream.
value
- input stream.@Deprecated public OutputStream getOutputStream()
Gets the output stream.
@Deprecated public void setOutputStream(OutputStream value)
This method is Deprecated. Use Save(outputStream) method for getting facade results.
value
- output stream.@Deprecated public String getInputFile()
Gets the input file.
@Deprecated public void setInputFile(String value)
@Deprecated public String getOutputFile()
Gets the output file.
@Deprecated public void setOutputFile(String value)
Sets the output file.
value
- String valuepublic void setWordWrap(boolean value)
Sets a bool value that indicates word wrap in AddText methods. If the value is true, the text in FormattedText will word wrap. By defalt, the value is false.
value
- boolean valuepublic int getWrapMode()
Gets word wrapping algorithm.
WordWrapMode
public void setWrapMode(int value)
Sets word wrapping algorithm.
value
- WordWrapMode elementWordWrapMode
public int getTextPositioningMode()
Gets text positioning strategy. PositioningMode
Default mode is Legacy.
PositioningMode
public void setTextPositioningMode(int value)
Sets text positioning strategy. PositioningMode
Default mode is Legacy.
value
- PositioningMode elementPositioningMode
public boolean addImage(InputStream imageStream, int pageNum, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY)
Adds image to the specified page of PDF document at specified coordinates.
PdfFileMend mendor = new PdfFileMend("example.pdf", "out_example.pdf"); InputStream stream = new FileInputStream("picture.jpg")) mendor.addImage(stream, 1, 10, 10, 100, 100); mendor.close();
imageStream
- Input image stream.pageNum
- The number of page that will receive the image.lowerLeftX
- The lower left x of image rectangle.lowerLeftY
- The lower left y of image rectangle.upperRightX
- The upper right x of image rectangle.upperRightY
- The upper right y of image rectangle.public boolean addImage(InputStream imageStream, int pageNum, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY, CompositingParameters compositingParameters)
Adds image to the specified page of PDF document at specified coordinates.
PdfFileMend mendor = new PdfFileMend("example.pdf", "out_example.pdf"); InputStream stream = new FileInputStream("picture.jpg")) mendor.addImage(stream, 1, 10, 10, 100, 100, new CompositingParameters(BlendMode.Multiply); mendor.close();
imageStream
- Input image stream.pageNum
- The number of page that will receive the image.lowerLeftX
- The lower left x of image rectangle.lowerLeftY
- The lower left y of image rectangle.upperRightX
- The upper right x of image rectangle.upperRightY
- The upper right y of image rectangle.compositingParameters
- The graphics compositing parameters for the image.public boolean addImage(InputStream imageStream, int[] pageNums, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY)
Adds image to the specified pages of PDF document at specified coordinates.
PdfFileMend mendor = new PdfFileMend("example.pdf", "out_example.pdf"); InputStream stream = new FileInputStream("picture.jpg") mendor.addImage(stream, new int[]{1, 2}, 10, 10, 100, 100); mendor.close();
imageStream
- Input image stream.pageNums
- The numbers of pages that will receive the image.lowerLeftX
- The lower left x of image rectangle.lowerLeftY
- The lower left y of image rectangle.upperRightX
- The upper right x of image rectangle.upperRightY
- The upper right y of image rectangle.public boolean addImage(InputStream imageStream, int[] pageNums, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY, CompositingParameters compositingParameters)
Adds image to the specified pages of PDF document at specified coordinates.
PdfFileMend mendor = new PdfFileMend("example.pdf", "out_example.pdf"); InputStream stream = new FileInputStream("picture.jpg") mendor.addImage(stream, new int[]{1, 2}, 10, 10, 100, 100, new CompositingParameters(BlendMode.Multiply); mendor.close();
imageStream
- Input image stream.pageNums
- The numbers of pages that will receive the image.lowerLeftX
- The lower left x of image rectangle.lowerLeftY
- The lower left y of image rectangle.upperRightX
- The upper right x of image rectangle.upperRightY
- The upper right y of image rectangle.compositingParameters
- The graphics compositing parameters for the images.public boolean addImage(String imageName, int pageNum, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY)
Adds image to the specified page of PDF document at specified coordinates.
PdfFileMend mendor = new PdfFileMend("example.pdf", "out_example.pdf"); mendor.addImage("picture.jpg", 1, 10, 10, 100, 100); mendor.close();
imageName
- The path of input image file.pageNum
- The number of page that will receive the image.lowerLeftX
- The lower left x of image rectangle.lowerLeftY
- The lower left y of image rectangle.upperRightX
- The upper right x of image rectangle.upperRightY
- The upper right y of image rectangle.public boolean addImage(String imageName, int pageNum, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY, CompositingParameters compositingParameters)
Adds image to the specified page of PDF document at specified coordinates.
PdfFileMend mendor = new PdfFileMend("example.pdf", "out_example.pdf"); mendor.addImage("picture.jpg", 1, 10, 10, 100, 100, new CompositingParameters(BlendMode.Multiply)); mendor.close();
imageName
- The path of input image file.pageNum
- The number of page that will receive the image.lowerLeftX
- The lower left x of image rectangle.lowerLeftY
- The lower left y of image rectangle.upperRightX
- The upper right x of image rectangle.upperRightY
- The upper right y of image rectangle.compositingParameters
- The graphics compositing parameters for the images.public boolean addImage(String imageName, int[] pageNums, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY)
Adds image to the specified pages of PDF document at specified coordinates.
PdfFileMend mendor = new PdfFileMend("example.pdf", "out_example.pdf"); mendor.addImage("picture.jpg", 1, 10, 10, 100, 100); mendor.close();
imageName
- The path of input image file.pageNums
- The numbers of pages that will receive the image.lowerLeftX
- The lower left x of image rectangle.lowerLeftY
- The lower left y of image rectangle.upperRightX
- The upper right x of image rectangle.upperRightY
- The upper right y of image rectangle.public boolean addImage(String imageName, int[] pageNums, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY, CompositingParameters compositingParameters)
Adds image to the specified pages of PDF document at specified coordinates.
PdfFileMend mendor = new PdfFileMend("example.pdf", "out_example.pdf"); mendor.addImage("picture.jpg", 1, 10, 10, 100, 100, new CompositingParameters(BlendMode.Multiply)); mendor.close();
imageName
- The path of input image file.pageNums
- The numbers of pages that will receive the image.lowerLeftX
- The lower left x of image rectangle.lowerLeftY
- The lower left y of image rectangle.upperRightX
- The upper right x of image rectangle.upperRightY
- The upper right y of image rectangle.compositingParameters
- The graphics compositing parameters for the images.public boolean addText(FormattedText text, int pageNum, float lowerLeftX, float lowerLeftY)
Not implemented.
text
- FormattedText object.pageNum
- Page number.lowerLeftX
- Lower left X coordinate.lowerLeftY
- Lower left Y coordinate.public boolean addText(FormattedText text, int pageNum, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY)
Not implemented.
text
- FormattedText object.pageNum
- Page number.lowerLeftX
- Lower left X coordinate.lowerLeftY
- Lower left Y coordinate.upperRightX
- Upper right X coordinate.upperRightY
- Upper right Y coordinate.public boolean addText(FormattedText text, Integer[] pageNums, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY)
Not implemented.
text
- FormattedText object.pageNums
- Page numbers array.lowerLeftX
- Lower left X coordinate.lowerLeftY
- Lower left Y coordinate.upperRightX
- Upper right X coordinate.upperRightY
- Upper right Y coordinate.public void close()
Closes PdfFileMend object.
public void dispose()
public void save(String destFile)
Saves the PDF document to the specified file.
save
in interface ISaveableFacade
save
in class SaveableFacade
destFile
- The destination file.public void save(OutputStream destStream)
Saves the PDF document to the specified file.
save
in interface ISaveableFacade
save
in class SaveableFacade
destStream
- The destination stream.public IDocument getDocument()
Gets the document PdfFileMend
is working on.
getDocument
in class Facade