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(FileInputStream inputStream,
FileOutputStream outputStream)
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)
Initializes new
PdfFileMend object on base of the document . |
PdfFileMend(com.aspose.ms.System.IO.Stream inputStream,
FileOutputStream 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,
int[] 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()
Disposes the facade.
|
IDocument |
getDocument()
Gets the document
PdfFileMend is working on. |
String |
getInputFile()
Deprecated.
|
InputStream |
getInputStream() |
String |
getOutputFile()
Deprecated.
|
OutputStream |
getOutputStream() |
int |
getTextPositioningMode()
Sets or gets text positioning strategy.
|
int |
getWrapMode()
Sets or gets word wrapping algorithm.
|
void |
isWordWrap(boolean value)
Sets a bool value that indicates word wrap in AddText methods.
|
void |
save(OutputStream destStream)
Saves the result PDF document to stream.
|
void |
save(String destFile)
Saves the result PDF document to file.
|
void |
setInputFile(String value)
Deprecated.
|
void |
setInputStream(InputStream value) |
void |
setOutputFile(String value)
Deprecated.
|
void |
setOutputStream(OutputStream value) |
void |
setOutputStream(com.aspose.ms.System.IO.Stream value)
Sets the output stream.
|
void |
setTextPositioningMode(int value) |
void |
setWrapMode(int value) |
save
public PdfFileMend()
Constructor.
@Deprecated public PdfFileMend(String inputFileName, String outputFileName)
Constructor.
inputFileName
- Input PDF file name.outputFileName
- Output PDF file name.public PdfFileMend(FileInputStream inputStream, FileOutputStream outputStream)
Constructor.
inputStream
- Input PDF stream.outputStream
- Output PDF stream.@Deprecated public PdfFileMend(com.aspose.ms.System.IO.Stream inputStream, FileOutputStream outputStream)
@Deprecated public PdfFileMend(com.aspose.ms.System.IO.Stream inputStream, com.aspose.ms.System.IO.Stream outputStream)
Constructor.
inputStream
- Input PDF stream.outputStream
- Output PDF stream.public PdfFileMend(IDocument document)
Initializes new PdfFileMend
object on base of the document
.
document
- Pdf document.public PdfFileMend(IDocument document, String outputFileName)
Initializes new PdfFileMend
object on base of the document
.
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
.
document
- Pdf document.destStream
- Output PDF stream.public InputStream getInputStream()
public void setInputStream(InputStream value)
public OutputStream getOutputStream()
public void setOutputStream(OutputStream value)
@Deprecated public String getInputFile()
Sets the input file.
@Deprecated public void setInputFile(String value)
@Deprecated public String getOutputFile()
Sets the output file.
@Deprecated public void setOutputFile(String value)
Sets the output file.
public void setOutputStream(com.aspose.ms.System.IO.Stream value)
Sets the output stream.
public void isWordWrap(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.
public int getWrapMode()
Sets or gets word wrapping algorithm. See WordWrapMode and IsWordWrap.
public void setWrapMode(int value)
public int getTextPositioningMode()
Sets or gets text positioning strategy. PositioningMode
Default mode is Legacy.
public void setTextPositioningMode(int value)
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"); Stream stream = File.OpenRead("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"); Stream stream = File.OpenRead("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"); using (Stream stream = File.OpenRead("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"); using (Stream stream = File.OpenRead("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
- pageNum
- lowerLeftX
- lowerLeftY
- public boolean addText(FormattedText text, int pageNum, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY)
Not implemented.
text
- pageNum
- lowerLeftX
- lowerLeftY
- upperRightX
- upperRightY
- public boolean addText(FormattedText text, int[] pageNums, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY)
Not implemented.
text
- pageNums
- lowerLeftX
- lowerLeftY
- upperRightX
- upperRightY
- public void close()
Closes PdfFileMend object.
public void dispose()
Facade
Disposes the facade.
public void save(String destFile)
ISaveableFacade
save
in interface ISaveableFacade
save
in class SaveableFacade
public void save(OutputStream destStream)
ISaveableFacade
save
in interface ISaveableFacade
save
in class SaveableFacade
public IDocument getDocument()
Gets the document PdfFileMend
is working on.
getDocument
in class Facade
Copyright © 2019 Aspose. All Rights Reserved.