Altsoft Xml2PDF reference library
APEngine Class
NamespacesAltsoft.PublisherAPEngine
Facade class for Altsoft Xml2PDF functionality.
Declaration Syntax
C#Visual BasicVisual C++
[ClassInterfaceAttribute(ClassInterfaceType.AutoDual)]
[GuidAttribute("54C0D56B-CF1A-423e-9E34-62F595461588")]
public sealed class APEngine : IDisposable
<ClassInterfaceAttribute(ClassInterfaceType.AutoDual)> _
<GuidAttribute("54C0D56B-CF1A-423e-9E34-62F595461588")> _
Public NotInheritable Class APEngine _
	Implements IDisposable
[ClassInterfaceAttribute(ClassInterfaceType::AutoDual)]
[GuidAttribute(L"54C0D56B-CF1A-423e-9E34-62F595461588")]
public ref class APEngine sealed : IDisposable
Remarks

The APEngine is the root class of the Xml2PDF Server. It is used for storage of all the data required for formatting. All entire objects that are used in the Xml2PDF are created here. These are:

APConfig
Set of options configuring a certain formatting call. It allows to set all general, input and output settings. All settings are grouped into classes (see Altsoft.Publisher.Configuration namespace). The APConfig is passed to the corresponding APDestination instance. It can't be shared between several APDestination instances.
APDestination

It is an output document. All APDestination instances can have one of the following types:

  • simple destination
  • typed destination
  • fast destination

The APDestination allows you to save any of its pages as an image, print the whole document through the GDI+ PrintDocument interface and allows saving it to one of the output formats (see APDestinationFormat).

Simple destination is one that doesn't contain the information about saving. It allows you saving a document several times into different formats. But it can not use critical features of the output format conflicting with other formats.

For example, PDF output format allows using 14 Standard PDF Type1 fonts. This can significantly reduce the size of an output file, but other output formats can not reproduce this feature.

Typed destination contains the information about its output format. This allows using critical features described above, but forbids saving to other formats. It also prohibits printing the document and saving pages as images.

Fast destination is intended for huge documents. It works according to the page-by-page rule: as soon as the formatting of a page is finished it is immidiately saved to the output. The rest of the document including resources is saved in the end of formatting process. Using this type of destination you are to define all information about the output at the creation time. Directly saving method is not used. Instead you use Close()()() method. Consequently, fast destination knows its output format and works the same as Typed destination.


APSource

It is an input document. You can use several input documents for one destination. The source documents can be merged consequently with Append(APSource) method and its overrides. Source document can also be used as a background with AddBackground(APSource, Int32, Int32, Boolean, Double) method.

For xml-based documents you can use XSLT transformations with ApplyXSLT(String, APLog) method and its overrides.


The typical use of the Xml2PDF Server contains several stages. You should do the following:

C#Visual Basic
             // create engine instance
             APEngine engine = new APEngine();
             
             // initialize engine with serial-key
             // you should use empty string for evaluation
             const string serialKey = "";
             engine.Load(serialKey);
            
             // create config
             APConfig config = engine.CreateConfig();
             
             // set config options
             config.Fonts.DefaultFont = "Arial";
             config.Output.DPI = 300;
             
             // create destination
             APDestination dest = engine.CreateDestination(config);
             // use CreateFastDestination() for fast destinations
             // APDestination dest = engine.CreateFastDestination(APDestinationFormat.PDF, 
             //                                         "output.pdf", new APLog(), config);
             
             // create one or several sources and put it to the destination
             APSource srcFO = engine.CreateSourceFO("in1.fo");
             dest.Append(srcFO);
             
             APSource srcDoc = engine.CreateSourceWordDoc("in2.doc");
             dest.Append(srcDoc);
             
             // perform output actions with the destination
             dest.Save(APDestinationFormat.PDF, "output.pdf");
             // call Close() for fast destinations
             // dest.Close();
             ' create engine instance
             Dim engine As APEngine = New APEngine
             
             ' initialize engine with serial-key
             ' you should use empty string for evaluation
             Const serialKey As String = ""
             engine.Load(serialKey)
             
             ' create config
             Dim config As APConfig = engine.CreateConfig()
             
             ' set config options
             config.Fonts.DefaultFont = "Arial"
             config.Output.DPI = 300
             
             ' create destination
             Dim dest As APDestination = engine.CreateDestination(config)
             ' use CreateFastDestination() for fast destinations
             ' Dim dest As APDestination = engine.CreateFastDestination(APDestinationFormat.PDF,
             '                                                "output.pdf", New APLog(), config)
             
             ' create one or several sources and put it to the destination
             Dim srcFO as APSource = engine.CreateSourceFO("in1.fo")
             dest.Append(srcFO)
             
             Dim srcDoc as APSource = engine.CreateSourceWordDoc("in2.doc")
             dest.Append(srcDoc)
             
             ' perform output actions with the destination
             dest.Save(APDestinationFormat.PDF, "output.pdf")
             ' call Close() for fast destinations
             ' dest.Close()
Members
All MembersConstructorsMethodsProperties



IconMemberDescription
APEngine(Boolean)
Creates a new instance of the APEngine class.

APEngine()()()
Creates a new instance of the thread-safe APEngine class.

APEngine(Boolean, array<String>[]()[])
APEngine(Boolean, array<String>[]()[], APFileSystem)
CreateConfig()()()
Creates a new APConfig instance with the application default settings.

CreateConfig(String)
Creates a new APConfig instance using settings stored in the given file.

CreateConfig(Stream)
Creates a new APConfig instance using settings stored in the given stream.

CreateConfig(XmlReader)
Creates a new APConfig instance using settings stored in the xml source.

CreateDestination(APConfig)
Creates a new output document instance with the given settings.

CreateDestination(APConfig, APDestinationFormat)
Creates a new output document instance with the given settings.

CreateDestination()()()
Creates a new output document instance with the default settings.

CreateDestination(APDestinationFormat)
Creates a new output document instance with the default settings.

CreateFastDestination(APDestinationFormat, Stream, Boolean, APLog, APConfig)
Creates a document optimized for huge input documents.

CreateFastDestination(APDestinationFormat, String, APLog, APConfig)
Creates a document optimized for huge input documents.

CreateSource(String)
Creates a new APSource instance.

CreateSource(String, APSourceFormat)
Creates a new APSource instance.

CreateSource(Stream, String, APSourceFormat, Boolean)
CreateSourceFO(String)
Creates a new FO source.

CreateSourceFO(Stream, String, Boolean)
Creates a new FO source.

CreateSourceSVG(String)
Creates a new SVG source.

CreateSourceSVG(Stream, String, Boolean)
Creates a new SVG source.

CreateSourceSVGZ(String)
Creates a new SVGZ source.

CreateSourceSVGZ(Stream, String, Boolean)
Creates a new SVGZ source.

CreateSourceWord2003Xml(String)
Creates a new Word2003Xml source.

CreateSourceWord2003Xml(Stream, String, Boolean)
Creates a new Word2003Xml source.

CreateSourceWord2007DocX(String)
Creates a new Word2007DocX source.

CreateSourceWord2007DocX(Stream, String, Boolean)
Creates a new Word2007DocX source.

CreateSourceWord2007Xml(String)
Creates a new Word2007Xml source.

CreateSourceWord2007Xml(Stream, String, Boolean)
Creates a new Word2007Xml source.

CreateSourceWordDoc(String)
Creates a new WordDoc source.

CreateSourceWordDoc(Stream, String, Boolean)
Creates a new WordDoc source.

CreateSourceXHTML(String)
Creates a new XHTML source.

CreateSourceXHTML(Stream, String, Boolean)
Creates a new XHTML source.

IDisposable..::.Dispose()()()
Engine
Gets the default Xml2PDF engine.

Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Expires
Gets the evaluation expiration date.

Finalize()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GetHashCode()()()
Serves as a hash function for a particular type. GetHashCode()()() is suitable for use in hashing algorithms and data structures like a hash table.
(Inherited from Object.)
GetType()()()
Gets the Type of the current instance.
(Inherited from Object.)
Load(String, APLog, Double)
Initializes the Altsoft Xml2PDF library core.

Load(String)
Initializes the Altsoft Xml2PDF library core.

LoadAppDefaults(String)
Loads the application default settings from the configuration section with the given name.

MemberwiseClone()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
ProductEdition
Gets the current product edition.

ToString()()()
Returns a String that represents the current Object.
(Inherited from Object.)
Unload(APLog, Double)
Performs clean-up of the resources used by the Altsoft Xml2PDF engine.

Unload()()()
Performs a clean-up of the resources used by the Altsoft Xml2PDF engine.

Inheritance Hierarchy
Object
APEngine

Assembly: Altsoft.Xml2PDF.Server (Module: Altsoft.Xml2PDF.Server)