iText 7 7.1.8 API
iText.Kernel.Pdf.PdfWriter Class Reference
Inheritance diagram for iText.Kernel.Pdf.PdfWriter:
iText.Kernel.Pdf.PdfOutputStream iText.IO.Source.OutputStream< iText.Kernel.Pdf.PdfOutputStream >

Public Member Functions

 PdfWriter (FileInfo file)
 Create a PdfWriter writing to the passed File and with default writer properties. More...
 
 PdfWriter (Stream os)
 Create a PdfWriter writing to the passed outputstream and with default writer properties. More...
 
 PdfWriter (Stream os, WriterProperties properties)
 
 PdfWriter (String filename)
 Create a PdfWriter writing to the passed filename and with default writer properties. More...
 
 PdfWriter (String filename, WriterProperties properties)
 Create a PdfWriter writing to the passed filename and using the passed writer properties. More...
 
virtual bool IsFullCompression ()
 Indicates if to use full compression mode. More...
 
virtual int GetCompressionLevel ()
 Gets default compression level for More...
 
virtual iText.Kernel.Pdf.PdfWriter SetCompressionLevel (int compressionLevel)
 Sets default compression level for More...
 
virtual iText.Kernel.Pdf.PdfWriter SetSmartMode (bool smartMode)
 Sets the smart mode. More...
 
- Public Member Functions inherited from iText.Kernel.Pdf.PdfOutputStream
 PdfOutputStream (Stream outputStream)
 Create a pdfOutputSteam writing to the passed OutputStream. More...
 
virtual iText.Kernel.Pdf.PdfOutputStream Write (PdfObject pdfObject)
 Write a PdfObject to the outputstream. More...
 
- Public Member Functions inherited from iText.IO.Source.OutputStream< iText.Kernel.Pdf.PdfOutputStream >
 OutputStream (Stream outputStream)
 
virtual void Write (int b)
 
Exceptions
System.IO.IOException

 
virtual void Write (byte[] b)
 
Exceptions
System.IO.IOException

 
override void Write (byte[] b, int off, int len)
 
Exceptions
System.IO.IOException

 
override long Seek (long offset, SeekOrigin origin)
 
override void SetLength (long value)
 
override int Read (byte[] buffer, int offset, int count)
 
override void WriteByte (byte value)
 
virtual T WriteByte (int value)
 
override void Flush ()
 
Exceptions
System.IO.IOException

 
virtual T WriteLong (long value)
 
virtual T WriteInteger (int value)
 
virtual T WriteFloat (float value)
 
virtual T WriteFloat (float value, bool highPrecision)
 
virtual T WriteFloats (float[] value)
 
virtual T WriteDouble (double value)
 
virtual T WriteDouble (double value, bool highPrecision)
 
virtual T WriteSpace ()
 
virtual T WriteNewLine ()
 
virtual T WriteString (String value)
 
virtual T WriteBytes (byte[] b)
 
virtual T WriteBytes (byte[] b, int off, int len)
 
virtual long GetCurrentPos ()
 
virtual Stream GetOutputStream ()
 
virtual bool IsCloseStream ()
 
virtual void SetCloseStream (bool closeStream)
 
virtual void AssignBytes (byte[] bytes, int count)
 
virtual void Reset ()
 

Additional Inherited Members

- Static Public Member Functions inherited from iText.IO.Source.OutputStream< iText.Kernel.Pdf.PdfOutputStream >
static bool GetHighPrecision ()
 
static void SetHighPrecision (bool value)
 
- Protected Member Functions inherited from iText.IO.Source.OutputStream< iText.Kernel.Pdf.PdfOutputStream >
override void Dispose (bool disposing)
 
- Properties inherited from iText.IO.Source.OutputStream< iText.Kernel.Pdf.PdfOutputStream >
override bool CanRead [get]
 
override bool CanSeek [get]
 
override bool CanWrite [get]
 
override long Length [get]
 
override long Position [get, set]
 

Constructor & Destructor Documentation

◆ PdfWriter() [1/4]

iText.Kernel.Pdf.PdfWriter.PdfWriter ( FileInfo  file)
inline

Create a PdfWriter writing to the passed File and with default writer properties.

Parameters
fileFile to write to.
Exceptions
System.IO.FileNotFoundException

◆ PdfWriter() [2/4]

iText.Kernel.Pdf.PdfWriter.PdfWriter ( Stream  os)
inline

Create a PdfWriter writing to the passed outputstream and with default writer properties.

Parameters
osOutputstream to write to.

◆ PdfWriter() [3/4]

iText.Kernel.Pdf.PdfWriter.PdfWriter ( String  filename)
inline

Create a PdfWriter writing to the passed filename and with default writer properties.

Parameters
filenamefilename of the resulting pdf.
Exceptions
System.IO.FileNotFoundException

◆ PdfWriter() [4/4]

iText.Kernel.Pdf.PdfWriter.PdfWriter ( String  filename,
WriterProperties  properties 
)
inline

Create a PdfWriter writing to the passed filename and using the passed writer properties.

Parameters
filenamefilename of the resulting pdf.
propertieswriterproperties to use.
Exceptions
System.IO.FileNotFoundException

Member Function Documentation

◆ GetCompressionLevel()

virtual int iText.Kernel.Pdf.PdfWriter.GetCompressionLevel ( )
inlinevirtual

Gets default compression level for

See also
PdfStream.

Gets default compression level for

See also
PdfStream. For more details
iText.IO.Source.DeflaterOutputStream
Returns
compression level.

◆ IsFullCompression()

virtual bool iText.Kernel.Pdf.PdfWriter.IsFullCompression ( )
inlinevirtual

Indicates if to use full compression mode.

Returns
true if to use full compression, false otherwise.

◆ SetCompressionLevel()

virtual iText.Kernel.Pdf.PdfWriter iText.Kernel.Pdf.PdfWriter.SetCompressionLevel ( int  compressionLevel)
inlinevirtual

Sets default compression level for

See also
PdfStream.

Sets default compression level for

See also
PdfStream. For more details
iText.IO.Source.DeflaterOutputStream
Parameters
compressionLevelcompression level.

◆ SetSmartMode()

virtual iText.Kernel.Pdf.PdfWriter iText.Kernel.Pdf.PdfWriter.SetSmartMode ( bool  smartMode)
inlinevirtual

Sets the smart mode.

Sets the smart mode.
In smart mode when resources (such as fonts, images,...) are encountered, a reference to these resources is saved in a cache, so that they can be reused. This requires more memory, but reduces the file size of the resulting PDF document.

Parameters
smartModeTrue for enabling smart mode.