 |
General
What is Gnostice eDocEngine?
Why do I need electronic document creation?
Why should I use Gnostice eDocEngine for electronic document creation?
Who can use eDocEngine?
Can I edit PDF or other supported document formats using eDocEngine?
What are the minimum requirements for using eDocEngine?
Can I try eDocEngine before I buy?
What are the limitations of the trial version?
Does Gnostice eDocEngine require Adobe® Acrobat™ or Microsoft® Office™ to work?
Do I need to supply any additional files with my application for eDocEngine to work?
How do I buy Gnostice eDocEngine?
Technical
How do I generate a minimal blank document with multiple pages in it?
How do I render a single line of text?
How do I insert a paragraph of text with a single method call and get the text to justify?
How do I insert a table with text in it?
How do I insert images to the document I'm creating?
How do I insert shapes to the document I'm creating?
How do I render a metafile to the documents?
How do I insert WaterMark to the documents?
How do I set Header/Footer content?
How do I add form elements to the documents I'm creating?
How do I create a Table of Contents page when creating an HTML document?
How do I add bookmarks when creating a PDF document?
How do I place values in specific cells and set the format when creating an Excel document?
How do I create a document with different page sizes and orientations?
General
What is Gnostice eDocEngine?
Gnostice eDocEngine ActiveX/.NET is a generic electronic document creation component suite for Microsoft Visual Studio, Microsoft Visual Studio .NET, Microsoft Visual FoxPro and other .NET platforms. eDocEngine enables you to create rich electronic documents in over 18 popular formats, including PDF, RTF, HTML, Excel, TIFF, SVG, PNG, JPEG, Metafile and many more.
Why do I need electronic document creation?
For information to be delivered electronically, it needs to be stored in a form that is accessible by means of a computer. We can call this form an electronic document. Delivering information electronically has many advantages over traditional paper-based methods. Some of these advantages are: reduced operating costs, reusability of information; it can be interactive, easily archived, accessed and searched. For today’s businesses where information needs to flow to its users in a timely and intelligent way, electronic document creation plays a vital role.
Why should I use Gnostice eDocEngine for electronic document creation?
Gnostice eDocEngine is the most comprehensive and generic electronic document creation component suite available for Borland and Microsoft platforms. It has been built from the understanding gained from several years of research and knowing user needs. eDocEngine does all you need done with electronic document creation out of a single box and yet remains cost effective and highly optimized. eDocEngine is built on an open extensible architecture with the widest support for features and formats.
Who can use eDocEngine?
If you are a software developer and you use Microsoft Visual Studio, Microsoft Visual Studio .NET, Microsoft Visual FoxPro, Borland Delphi 8 . NET or Borland C#Builder to develop your software, you can use eDocEngine. eDocEngine enables your applications to create electronic document that can be distributed and used by the end-users of your application.
Can I edit PDF or other supported document formats using eDocEngine?
Editing of PDF or other documents is not supported in the current version of eDocEngine.
What are the minimum requirements for using eDocEngine?
Please see the System Requirements for complete details.
Can I try eDocEngine before I buy?
YES. The FREE full-feature trial versions of eDocEngine are available on the Download page.
What are the limitations of the trial version?
Trial versions have the following limitations:
• Created documents will contain no more than 5 pages of the programmed output.
• Each page of the created document will contain a message stating the document was created using the trial version of Gnostice eDocEngine and the Gnostice web site address printed at the top.
Does Gnostice eDocEngine require Adobe® Acrobat™ or Microsoft® Office™ to work?
NO. eDocEngine does not require any external software or DLLs to work.
Do I need to supply any additional files with my application for eDocEngine to work?
You only need to supply the library files along with the compiled executable (EXE) application to your users. Please see the Deployment topic in Help. Further, the License restricts the distribution of certain files supplied with eDocEngine. Please check the License section for details.
How do I buy Gnostice eDocEngine?
You can buy eDocEngine online and get instant access to the registered version. There are several payment options available. Please check the
Order section for details.
Technical
How do I generate a minimal blank document with multiple pages in it?
The following example uses a gtEngineX component to create a blank PDF document. You can use any other engine component to achieve the same for another document format.
[VB]
With gtEngineX1
.FileName = ".\BlankDoc"
.PagePaperSize = A4
'... Set any other document properties as required
.BeginDoc
'1st Page: Render text, image and other items here
.NewPage
'2nd Page: Render text, image and other items here
'Similarly render any number of pages using NewPage method
EndDoc
End With
[VC++]
m_Engine.SetFileName("BlankDoc");
m_Engine.SetPagePaperSize(A4);
/*Set any other document properties as required */
m_Engine.BeginDoc();
*1st Page: Render text, image and other items here*/
m_Engine.NewPage();
/*2nd Page: Render text, image and other items here*/
/*Similarly render any number of pages using NewPage method*/
m_Engine.EndDoc();
How do I render a single line of text?
[VB]
With gtEngineX1
.BeginDoc
'... Set any text properties as required
.TextOutXY 3, 4, "This is a sample line of text"
'... Change settings if necessary
.TextOutXY 0, 0, "This is another sample"
. EndDoc
End With
[VC++]
m_Engine.BeginDoc();
/*... Set any text properties as required*//
m_Engine.TextOutXY(3, 4, "This is a sample line of text");
/*... Change settings if necessary*/
m_Engine.TextOutXY 0, 0, "This is another sample"
m_Engine.EndDoc();
How do I insert a paragraph of text with a single method call and get the text to justify?
[VB]
Dim str As String
str = "Gnostice eDocEngine is a comprehensive, generic, electronic" _
& "document creation component suite for Borland® Delphi™" _
& " and Borland® C++Builder™. eDocEngine enables developers to deliver" _
& " information straight from the applications they develop in over 20" _
& " popular electronic document formats, including PDF, HTML, RTF, TIFF," _
& "XML graphics and many more."
With gtEngineX1
.BeginDoc
'... Set left indent, right indent and any other text formatting properties
.TextFormatting.BeforeSpace = 1.5
.TextFormatting.Alignment = haJustify
.BeginPara
.TextOut (str)
.EndPara
.EndDoc
End With
[VC++]
CString str = "Gnostice eDocEngine is a comprehensive, generic, electronic";
str += "document creation component suite for Borland® Delphi";
str += " and Borland® C++Builder. eDocEngine enables developers to deliver";
str += " information straight from the applications they develop in over 20";
str += " popular electronic document formats, including PDF, HTML, RTF, TIFF,";
str += "XML graphics and many more.";
m_Engine.BeginDoc();
CgtTextFormattingX txtFormat;
txtFormat = m_Engine.GetTextFormatting();
/*... Set left indent, right indent and any other text formatting properties*/
txtFormat.SetAlignment(haCenter);
txtFormat.SetBeforeSpace(1.5);
m_Engine.BeginPara();
m_Engine.TextOut(str);
m_Engine.EndPara();
m_Engine.EndDoc();
How do I insert a table with text in it?
[VB]
Dim LColumns As gtColumListX
With gtEngineX1
.BeginDoc
'Settings For Image to be inserted into the table
.ImageSettings.Transparent = True
.PenStyle = psSolid
.PenWidth = 2
.PenColor = RGB(0, 0, 255)
.BrushColor = RGB(0, 255, 255)
'Set attributes of the table being drawn using the TableSettings property
With .TableSettings
.RowHeight = 0.75
.AutoAdjustColumnWidth = False
.ColumnWidth = 1.5
.EnableTitle = True
.TitleHeight = 0.5
.SetInternalMargin 0.1, 0.1, 0.1, 0.1
End With
.Font.Bold = True
.Font.Size = 10
'Drawing a table of 5 columns at x=0.25, y=1 units
Set LColumns = .BeginTable
(0.25, 1, 5) 'Returns a list of gtColumnListX to which you can set specific column properties
LColumns.Columns(0).Title = "First Column"
LColumns.Columns(1).Title = "Second Column"
LColumns.Columns(2).Title = "Third Column"
LColumns.Columns(3).Title = "Fourth Column"
LColumns.Columns(4).Title = "Fifth Column"
.Font.Bold = False
.Font.Size = 8
For j = 0 To 2
.NewRow
For i = 0 To 4
If (i = 1) Then
'Inserting Image in the second Row of the table
.DrawImageC i, 130, 70, Image1.Picture.Handle, itBMP
Else
.TextColor = RGB(0, 0, 0)
.TextOutC i, "Row No. " & (j + 1) & Chr
(10) & Chr
(13) & " " + "Column No. " & (i + 1)
End If
Next
Next
.EndTable
.EndDoc
End With
[VC++]
CgtImageSettingsX imgSettings = m_Engine.GetImageSettings();
CString str1;
COleFont f = m_Engine.GetFont();
CY fontSize = m_Engine.GetFont().GetSize();
CgtTableSettingsX tblSettings;
tblSettings = m_Engine.GetTableSettings();
tblSettings.SetColumnWidth(1.5);
tblSettings.SetRowHeight(0.75);
tblSettings.SetEnableTitle(true);
tblSettings.SetTitleHeight(0.5);
tblSettings.SetInternalMargin(0.1,0.1,0.1,0.1);
m_Engine.BeginDoc();
m_Engine.BeginPara();
m_Engine.TextOut("Table Support");
m_Engine.EndPara();
imgSettings.SetTransparent(true);
m_Engine.SetPenStyle(psSolid);
m_Engine.SetPenWidth(2);
m_Engine.SetPenColor(RGB(0, 0, 255));
m_Engine.SetBrushColor(RGB(255, 255, 255));
f.SetBold(true);
fontSize.int64 = 100000;
f.SetSize(fontSize);
/*Drawing a table of 5 columns at x=0.25, y=1 units*/
CgtColumnListX columns;
columns = m_Engine.BeginTable(0.25,1,5);
m_Engine.SetTextColor(RGB(0,0,0));
columns.GetColumns(0).SetTitle("First Column");
columns.GetColumns(1).SetTitle("Second Column");
columns.GetColumns(2).SetTitle("Third Column");
columns.GetColumns(3).SetTitle("Fourth Column");
columns.GetColumns(4).SetTitle("Fifth Column");
f.SetBold(false);
fontSize.int64 = 80000;
f.SetSize(fontSize);
for (int j = 0; j<=2 ; j++)
{
m_Engine.NewRow();
for (int i=0; i<=4; i++)
{
/* Inserting Image in the second Row of the table */
/* m_CImage is of Microsoft Forms 2.0 Image Type */
if (i == 1)
m_Engine.DrawImageC
(i, 130, 70, m_CImage.GetPicture().GetHandle(),itBMP);
str1 = "RowNo ";
str1.Insert(str1.GetLength(), (j+49));
str1.Insert(str1.GetLength(), " ColumnNo ");
str1.Insert(str1.GetLength(), (i+49));
m_Engine.TextOutC(i,str1);
}
}
m_Engine.EndTable();
m_Engine.EndDoc();
How do I insert images to the document I'm creating?
[VB]
With gtEngineX1
//... Set Any image properties through ImageSettings Property
.BeginDoc
// Insert image at x=1, y=2 units
.DrawImageXY 1, 2, Image1.Picture.Handle, itBMP
//Insert image within a specified rectangle
.DrawImageR 2, 2, 6, 3, Image1.Picture.Handle, itBMP
.EndDoc
End With
AddImageAsResource
Dim I As Long
With gtEngineX1
.BeginDoc
I = .AddImageAsResource(Image1.Picture.Handle, itBMP)
//... Set Any image properties As required
//Draw image once
.DrawImageRI 1, 1, 4, 4, I
.NewPage
//Draw image again
.DrawImageRI 1, 1, 4, 4, I
.EndDoc
End With
[VC++]
m_Engine.BeginDoc();
//... set any image properties through ImageSettings property
// Insert image at x=1, y=2 units
m_Engine.DrawImageXY(1, 2, m_Cimage1.GetPicture().GetHandle
(), itBMP);
//Insert image within a specified rectangle
m_Engine.DrawImageR(2.5, 2.5, 5, 5, m_CImage2.GetPicture
().GetHandle(),
itBMP);
m_Engine.EndDoc();
AddImageAsResource
Long I;
m_Engine.BeginDoc();
I = m_Engine.AddImageAsResource(m_Cimage1.GetPicture().GetHandle(), itBMP);
//... set any image properties as required
//Draw image once
m_Engine.DrawImageRI(2, 2, 6, 3,I);
m_Engine.NewPage();
//Draw image again
m_Engine.DrawImageRI(2, 2, 6, 3,I);
m_Engine.EndDoc();
How do I insert shapes to the document I'm creating?
[VB]
With gtEngineX1
.FileName = "C:\Shapes"
.MeasurementUnit = muInches
.PagePaperSize = A4
.PageLeftMargin = 0.5
.PageRightMargin = 0.5
.PageBottomMargin = 0.5
.PageTopMargin = 0.5
'... Set any other document properties as required
.BeginDoc
.PenColor = RGB(0, 0, 0)
.BrushColor = RGB(180, 180, 180)
'... Set/Change Pen and Brush at any point.
'Last parameter specifies if the shape needs to be filled with
'the current brush
.Ellipse 1.5, 2.5, 4, 3.5, False
.PenStyle = psDashDot
.BrushStyle = bsFDiagonal
.BrushColor = RGB(0, 255, 0)
.RoundRect 6.3, 5.6, 7.3, 7.5, 0.25, 0.15, True
.Arc 4.2, 2.2, 6, 2.6, 4.5, 6, 4, 4
.Chord 0.2, 4, 3, 5, 2.3, 3, 4.3, 5, True
.Pie 4.2, 4, 5, 5, 3, 3, 4.5, 5.2, False
.PenColor = RGB(0, 0, 255)
.BrushColor = RGB(180, 180, 180)
.LineA 0.5, 5.5, 1.75, 7.7
.Rectangle 2, 5.5, 6, 7.8, True
EndDoc
End With
[VC++]
m_Engine.SetFileName("C:\\Shapes");
m_Engine.SetMeasurementUnit(muInches);
m_Engine.SetPagePaperSize(A4);
m_Engine.SetPageLeftMargin(0.5);
m_Engine.SetPageRightMargin(0.5);
m_Engine.SetPageBottomMargin(0.5);
m_Engine.SetPageTopMargin(0.5);
/*Set any other property as per the requirements*/
m_Engine.BeginDoc();
m_Engine.SetPenColor(RGB(0, 0, 0));
m_Engine.SetBrushColor(RGB(180, 180, 180));
m_Engine.Ellipse(1.5, 2.5, 4, 3.5, false);
m_Engine.SetPenStyle(psDashDot);
m_Engine.SetBrushStyle(bsFDiagonal);
m_Engine.SetBrushColor(RGB(0, 255, 0));
m_Engine.RoundRect(6.3, 5.6, 7.3, 7.5, 0.25, 0.15, true);
m_Engine.Arc(4.2, 2.2, 6, 2.6, 4.5, 6, 4, 4);
m_Engine.Chord(0.2, 4, 3, 5, 2.3, 3, 4.3, 5, true);
m_Engine.Pie(4.2, 4, 5, 5, 3, 3, 4.5, 5.2, false);
m_Engine.SetPenColor(RGB(0, 0, 255));
m_Engine.SetBrushColor(RGB(180, 180, 180));
m_Engine.LineA(0.5, 5.5, 1.75, 7.7);
m_Engine.Rectangle(2, 5.5, 6, 7.8, true);
m_Engines.EndDoc();
How do I render a metafile to the documents?
[VB]
With gtEngineX1
.FileName = "C:\\Metafile"
.BeginDoc
.PlayMetafile Image1.Picture.Handle
.EndDoc
End With
[VC++]
m_Engine.SetFileName("C:\\Metafile");
m_Engine.BeginDoc();
m_Engine.PlayMetafile(m_CImage1.GetPicture().GetHandle());
m_Engine.EndDoc();
How do I insert WaterMark to the documents?
With the following code a watermark is inserted into every page of the created document:
[VB]
With gtEngineX1
.FileName = "C:\WaterMark"
.BeginDoc
'Start WaterMark
.BeginWaterMark
.Font.Name = "Verdana"
.Font.Size = 12
.TextColor = RGB(0, 0, 255)
.TextFormatting.Alignment = haCenter
.TextFormatting.Alignment = 2
.BeginPara
.TextOut "Gnostice Information Technologies Private Limited"
.EndPara
.ImageSettings.Stretch = True
.ImageSettings.KeepAspectRatio = True
.DrawImageXY 2.5, 2.5, Image1.Picture.Handle, itBMP
.EndWaterMark
.NewPage
.EndDoc
End With
[VC++]
m_Engine.SetFileName("C:\\WaterMarks");
m_Engine.BeginDoc();
/*start watermark*/
m_Engine.BeginWaterMark();
COleFont f = m_Engine.GetFont();
f.SetName("Verdana");
CY fontSize = m_Engine.GetFont().GetSize();
fontSize.int64 = 120000;
f.SetSize(fontSize);
m_Engine.GetTextFormatting();
txtFormat.SetAlignment(haCenter);
txtFormat.SetBeforeSpace(2);
m_Engine.BeginPara();
m_Engine.TextOut
("Gnostice Information Technologies Private Limited");
m_Engine.EndPara();
CgtImageSettingsX imgSettings = m_Engine.GetImageSettings();
imgSettings.SetStretch(true);
imgSettings.SetKeepAspectRatio(true);
m_Engine.DrawImageXY(2.5, 2.5,m_CImage2.GetPicture().GetHandle
(), itBMP);
m_Engine.EndWaterMark();
m_Engine.NewPage();
m_Engine.EndDoc();
How do I set Header/Footer content?
[VB]
With gtEngineX1
.FileName = "C:\HeaderFooter"
.MeasurementUnit = muInches
.PagePaperSize = A4
.PageHeaderHeight = 2
.PageFooterHeight = 2
.BeginDoc
If Not (.EngineStatus = esStarted) Then Exit Sub
.BeginHeader
.Font.Name = "Courier New"
.Font.Size = 10
.TextColor = RGB(0, 0, 255)
.TextFormatting.Alignment = haRight
.TextFormatting.BeforeSpace = 1.1
.BeginPara
.TextOut ("Document Header")
.EndPara
.ImageSettings.Stretch = True
.ImageSettings.KeepAspectRatio = True
.DrawImageR 0.3, 0.9, 2, 2, Image1.Picture.Handle, itBMP
.EndHeader
.BeginFooter
.Font.Name = "Verdana"
.Font.Size = 10
.TextColor = RGB(255, 0, 0)
.TextOutXY 0.3, 0.9, "Gnostice Information Technologies Private Limited"
.TextOutXY 6, 0.9, "www.gnostice.com"
.EndFooter
.EndDoc
End With
[VC++]
m_Engine.SetFileName("HeaderFooter");
m_Engine.SetPagePaperSize(A4);
m_Engine.SetMeasurementUnit(muInches);
m_Engine.SetPageHeaderHeight(2);
m_Engine.SetPageFooterHeight(2);
/*Set any other property as per the requirements*/
m_Engine.BeginDoc();
if(m_Engine.GetEngineStatus() != esStarted)
return;
/*start Header*/
m_Engine.BeginHeader();
COleFont f = m_Engine.GetFont();
f.SetName("Courier New");
CY fontSize = m_Engine.GetFont().GetSize();
fontSize.int64 = 100000;
f.SetSize(fontSize);
m_Engine.SetTextColor(RGB(0, 0, 255));
CgtTextFormattingX txtFormat;
txtFormat = m_Engine.GetTextFormatting();
txtFormat.SetAlignment(haRight);
txtFormat.SetBeforeSpace(1.1);
CgtImageSettingsX imgSettings = m_Engine.GetImageSettings();
m_Engine.BeginPara();
m_Engine.TextOut("Document Header");
m_Engine.EndPara();
imgSettings.SetStretch(true);
imgSettings.SetKeepAspectRatio(true);
m_Engine.DrawImageR(0.3, 0.9, 2, 2,m_CImage2.GetPicture
().GetHandle(), itBMP);
m_Engine.EndHeader();
/* start footer*/
m_Engine.BeginFooter();
f.SetName("Verdana");
fontSize.int64 = 100000;
f.SetSize(fontSize);
m_Engine.SetTextColor(RGB(255, 0, 0));
m_Engine.TextOutXY
(0.3, 0.9, "Gnostice Information Technologies Private Limited");
m_Engine.TextOutXY(6, 0.9, "www.gnostice.com");
m_Engine.EndFooter();
m_Engine.EndDoc();
How do I add form elements to the documents I'm creating?
[VB]
Dim PDFTextField As gtPDFFormTextFieldX
Dim PDFButton As gtPDFFormPushButtonX
With gtEngineX1
.FileName = "C:\PDFForm"
.MeasurementUnit = muPixels
.PagePaperSize = A4
.BeginDoc
Set PDFButton = .CreatePushButton
With PDFButton
.SetRect 350, 200, 470, 250
.Font.Name = "Comic Sans MS"
.Font.Size = 15
.FieldName = "ResetButton"
.NormalCaption = "Reset"
.RolloverCaption = "Rollover"
.DownCaption = "Down"
.Action = pbaReset
.BackgroundColor = RGB(140, 140, 140)
End With
Call .AddPushButton(PDFButton)
//Single Line Text
Set PDFTextField = .CreateTextField
With PDFTextField
.SetRect 240, 330, 565, 355
.Font.Size = 10
.TextColor = RGB(0, 0, 0)
.FieldName = "SingleLineText"
.BackgroundColor = RGB(189, 233, 253)
.Value = "Gnostice EDocEngine ActiveX"
.MaxLength = 30
End With
Call .AddTextField(PDFTextField)
.EndDoc
End With
[VC++]
CgtPDFFormPushButtonX pdfButton;
CgtPDFFormTextFieldX PDFTextField;
m_Engine.SetFileName("PDFForms");
m_Engine.SetMeasurementUnit(muPixels);
m_Engine.SetPagePaperSize(A4);
m_Engine.SetPageHeaderHeight(0);
m_Engine.SetPageFooterHeight(0);
m_Engine.BeginDoc();
/* Push Button */
pdfButton = m_Engine.CreatePushButton();
CY Buttonfont = pdfButton.GetFont().GetSize();
pdfButton.SetRect (350, 200, 470, 250);
Buttonfont.int64 = 150000;
pdfButton.GetFont().SetSize(Buttonfont);
pdfButton.GetFont().SetName("Comic Sans MS");
pdfButton.SetFieldName("ResetButton");
pdfButton.SetNormalCaption("Reset");
pdfButton.SetRolloverCaption("Rollover");
pdfButton.SetDownCaption("Down");
pdfButton.SetAction(pbaReset);
pdfButton.SetBackgroundColor(RGB(140, 140, 140));
m_Engine.AddPushButton(pdfButton.m_lpDispatch);
/* Single Line Text Field */
PDFTextField = m_Engine.CreateTextField();
PDFTextField.SetRect(240, 330, 565, 355);
PDFTextField.SetTextColor(RGB(0, 0, 0));
PDFTextField.SetFieldName("SingleLineText");
PDFTextField.SetBackgroundColor(RGB(189, 233, 253));
PDFTextField.SetValue("Gnostice eDocEngine");
PDFTextField.SetMaxLength(30);
m_Engine.AddTextField(PDFTextField.m_lpDispatch);
m_Engine.EndDoc();
How do I create a Table of Contents page when creating an HTML document?
[VB]
Dim LI As Long
With gtHTMLEngineX1
.FileName = ".\TableOfContents"
.MeasurementUnit = muPixels
.PagePaperSize = A4
.PrefSingleFile = False
.Navigator.Enabled = True
'.TOCPageSettings
With .TOCPageSettings
.ItemFont.Name = "Arial"
.ItemFont.Size = 12
.ItemTextColor = RGB(0, 0, 255)
.Title = "Table of Contents"
.TitleFont.Name = "Verdana"
.TitleFont.Size = 16
.TitleTextColor = RGB(255, 0, 0)
.TitleFont.Bold = True
.TitleFont.Underline = True
End With
.BeginDoc
If Not (.EngineStatus = esStarted) Then Exit Sub
.Font.Name = "Times New Roman"
.Font.Size = 20
.TextColor = RGB(0, 0, 255)
.TextFormatting.BeforeSpace = 400
.TextFormatting.Alignment = haCenter
.BeginPara
.TextOut ("eDocEngine")
.EndPara
.Font.Size = 18
.TextFormatting.BeforeSpace = 50
.BeginPara
.TextOut ("HTML Table of Contents Demo")
.EndPara
.NewPage
.TextFormatting.BeforeSpace = 120
.TextFormatting.Alignment = haRight
.Font.Size = 18
.TextColor = RGB(0, 0, 0)
.Font.Bold = True
.Font.Underline = True
.BeginPara
.TextOut ("Introduction")
.EndPara
.TextFormatting.BeforeSpace = 150
.Font.Underline = False
.TextFormatting.Alignment = haLeft
.Font.Size = 16
.BeginPara
.TextOut ("1.1. What is eDocEngine?")
.EndPara
.BeginPara
.TextOut ("1.2. System Requirements")
.EndPara
.BeginPara
.TextOut ("1.3. Legal Notices")
.EndPara
'Table of Contents Page
.AddTOCItem "HTML Table of Contents Demo", -1, 1, 0
LI = .AddTOCItem("1. Introduction", -1, 2, 145)
.AddTOCItem "1.1. What is eDocEngine?", LI, 2, 320
.AddTOCItem "1.2. System Requirements", LI, 2, 495
.AddTOCItem "1.3. Legal Notices", LI, 2, 670
.AddTOCItemL "www.gnostice.com", -1, "http://www.gnostice.com"
.EndDoc
End With
[VC++]
long LI;
m_HTMLEngine.SetFileName("TableOfContents");
m_HTMLEngine.SetMeasurementUnit(muPixels);
m_HTMLEngine.SetPagePaperSize(A4);
m_HTMLEngine.SetPrefSingleFile(false);
/*Set any other property as per the requirements*/
CgtHTMLNavigatorX navigator = m_HTMLEngine.GetNavigator();
navigator.SetEnabled(true);
CgtTOCPageSettingsX tocpagesettings = m_HTMLEngine.GetTOCPageSettings();
tocpagesettings.GetItemFont().SetName("Arial");
CY Itemfontsize = tocpagesettings.GetItemFont().GetSize();
Itemfontsize.int64 = 120000;
tocpagesettings.GetItemFont().SetSize(Itemfontsize);
tocpagesettings.SetItemTextColor(RGB(0, 0, 255));
tocpagesettings.GetTitleFont().SetName("Verdana");
CY Titlefontsize = tocpagesettings.GetTitleFont().GetSize();
Titlefontsize.int64 = 160000;
tocpagesettings.SetTitleTextColor(RGB(255, 0, 0));
tocpagesettings.GetTitleFont().SetBold(true);
tocpagesettings.GetTitleFont().SetUnderline(true);
tocpagesettings.SetTitle("Table of Contents");
m_HTMLEngine.BeginDoc();
if(m_HTMLEngine.GetEngineStatus() != esStarted)
return;
COleFont f = m_HTMLEngine.GetFont();
f.SetName("Times New Roman");
CY fontSize = m_HTMLEngine.GetFont().GetSize();
fontSize.int64 = 200000;
f.SetSize(fontSize);
m_HTMLEngine.SetTextColor(RGB(0, 0, 255));
CgtTextFormattingX txtFormat;
txtFormat = m_HTMLEngine.GetTextFormatting();
txtFormat.SetBeforeSpace(400);
txtFormat.SetAlignment(haCenter);
m_HTMLEngine.BeginPara();
m_HTMLEngine.TextOutXY (350,400,"eDocEngine");
m_HTMLEngine.EndPara();
fontSize.int64 = 180000;
f.SetSize(fontSize);
txtFormat.SetBeforeSpace(50);
m_HTMLEngine.BeginPara();
m_HTMLEngine.TextOutXY (300, 500, "HTML Table of Contents Demo");
m_HTMLEngine.EndPara();
m_HTMLEngine.NewPage();
txtFormat.SetBeforeSpace(120);
txtFormat.SetAlignment(haRight);
fontSize.int64 = 180000;
f.SetSize(fontSize);
m_HTMLEngine.SetTextColor(RGB(0, 0, 0));
f.SetBold(true);
f.SetUnderline(true);
m_HTMLEngine.BeginPara();
m_HTMLEngine.TextOutXY (500, 250, "Introduction");
m_HTMLEngine.EndPara();
txtFormat.SetBeforeSpace(150);
txtFormat.SetAlignment(haLeft);
fontSize.int64 = 160000;
f.SetSize(fontSize);
f.SetUnderline(false);
m_HTMLEngine.BeginPara();
m_HTMLEngine.TextOutXY (50, 350,"1.1 What is eDocEngine?");
m_HTMLEngine.EndPara();
m_HTMLEngine.BeginPara();
m_HTMLEngine.TextOutXY (50, 450,"1.2 System Requirements");
m_HTMLEngine.EndPara();
m_HTMLEngine.BeginPara();
m_HTMLEngine.TextOutXY (50, 550,"1.3 Legal Notices");
m_HTMLEngine.EndPara();
m_HTMLEngine.AddTOCItem("HTML Table of Contents Demo", -
1, 1, 0);
LI = m_HTMLEngine.AddTOCItem("1. Introduction", -1, 2, 145);
m_HTMLEngine.AddTOCItem( "1.1. What is eDocEngine?", LI, 2, 320);
m_HTMLEngine.AddTOCItem ("1.2. System Requirements", LI, 2, 495);
m_HTMLEngine.AddTOCItem ("1.3. Legal Notices", LI, 2, 670);
m_HTMLEngine.AddTOCItemL("www.gnostice.com", -
1, "http://www.gnostice.com");
m_HTMLEngine.EndDoc();
How do I add bookmarks when creating a PDF document?
[VB]
With gtPDFEngineX1
.FileName = "C:\PDFBookmarks"
.MeasurementUnit = muPixels
.PagePaperSize = A4
.BeginDoc
If Not (.EngineStatus = esStarted) Then Exit Sub
.Font.Name = "Times New Roman"
.Font.Size = 20
.TextColor = RGB(0, 0, 255)
.TextFormatting.BeforeSpace = 400
.TextFormatting.Alignment = haCenter
.BeginPara
.TextOut ("eDocEngine")
.EndPara
.Font.Size = 18
.TextFormatting.BeforeSpace = 50
.BeginPara
.TextOut ("PDF Bookmarks Demo")
.EndPara
.NewPage
.TextFormatting.BeforeSpace = 120
.TextFormatting.Alignment = haRight
.Font.Size = 18
.TextColor = RGB(0, 0, 0)
Font.Bold = True
Font.Underline = True
.BeginPara
.TextOut ("Introduction")
.EndPara
.TextFormatting.BeforeSpace = 150
Font.Underline = False
.TextFormatting.Alignment = haLeft
Font.Size = 16
.BeginPara
.TextOut ("1.1. What is eDocEngine?")
.EndPara
.BeginPara
.TextOut ("1.2. System Requirements")
.EndPara
.BeginPara
.TextOut ("1.3. Legal Notices")
.EndPara
' Bookmarks
.AddTOCItem "PDF Bookmarks Demo", -1, 1, 0
LI = .AddTOCItem("1. Introduction", -1, 2, 145)
.AddTOCItem "1.1. What is eDocEngine?", LI, 2, 320
.AddTOCItem "1.2. System Requirements", LI, 2, 495
.AddTOCItem "1.3. Legal Notices", LI, 2, 670
.AddTOCItemL "www.gnostice.com", -
1, "http://www.gnostice.com"
.ViewerPreferences.PageMode = pmUseOutlines
.EndDoc
.ViewerPreferences.PageMode = pmUseNone
End With
[VC++]
long LI;
m_PDFEngine.SetFileName("PDF Bookmarks");
m_PDFEngine.SetMeasurementUnit(muPixels);
m_PDFEngine.SetPagePaperSize(A4);
/*Set any other property as per the requirements*/
m_PDFEngine.BeginDoc();
if(m_PDFEngine.GetEngineStatus() != esStarted)
return;
CgtTextFormattingX txtFormat;
txtFormat = m_PDFEngine.GetTextFormatting();
txtFormat.SetAlignment(haCenter);
txtFormat.SetBeforeSpace(400);
COleFont f = m_PDFEngine.GetFont();
f.SetName("Times New Roman");
CY fontSize = m_PDFEngine.GetFont().GetSize();
fontSize.int64 = 200000;
f.SetSize(fontSize);
m_PDFEngine.SetTextColor(RGB(0, 0, 255));
m_PDFEngine.BeginPara();
m_PDFEngine.TextOut("eDocEngine");
m_PDFEngine.EndPara();
fontSize.int64 = 180000;
f.SetSize(fontSize);
txtFormat.SetBeforeSpace(50);
m_PDFEngine.BeginPara();
m_PDFEngine.TextOut("PDF Bookmarks Demo");
m_PDFEngine.EndPara();
m_PDFEngine.NewPage();
txtFormat.SetAlignment(haRight);
txtFormat.SetBeforeSpace(120);
fontSize.int64 = 180000;
f.SetSize(fontSize);
m_PDFEngine.SetTextColor(RGB(0, 0, 0));
f.SetBold(true);
f.SetUnderline(true);
m_PDFEngine.BeginPara();
m_PDFEngine.TextOut("Introduction");
m_PDFEngine.EndPara();
txtFormat.SetBeforeSpace(150);
txtFormat.SetAlignment(haLeft);
fontSize.int64 = 160000;
f.SetSize(fontSize);
f.SetUnderline(false);
m_PDFEngine.BeginPara();
m_PDFEngine.TextOut("1.1. What is eDocEngine?");
m_PDFEngine.EndPara();
m_PDFEngine.BeginPara();
m_PDFEngine.TextOut("1.2. System Reqirements");
m_PDFEngine.EndPara();
m_PDFEngine.BeginPara();
m_PDFEngine.TextOut("1.3. Legal Notices");
m_PDFEngine.EndPara();
m_PDFEngine.AddTOCItem("PDF Bookmarks Demo", -1, 1, 0);
LI = m_PDFEngine.AddTOCItem("1. Introduction", -1, 2, 145);
m_PDFEngine.AddTOCItem
("1.1. What is eDocEngine?", LI, 2, 320);
m_PDFEngine.AddTOCItem ("1.2. System Requirements", LI, 2, 495);
m_PDFEngine.AddTOCItem ("1.3. Legal Notices", LI, 2, 670);
m_PDFEngine.AddTOCItemL ("www.gnostice.com", -
1, "http://www.gnostice.com");
CgtViewerPreferencesX pref;
pref = m_PDFEngine.GetViewerPreferences();
pref.SetPageMode(pmUseOutlines);
m_PDFEngine.EndDoc();
Textout in ExcelEngine (Row Column)
How do I place values in specific cells and set the format when creating an Excel document?
[VB]
With gtExcelEngineX1
.FileName = "C:\Excel"
.BeginDoc
.TextOutRC 4, 4, "Text in 5th row, 5th column", haCenter, ctString
.EndDoc
End With
[VC++]
m_ExcelEngine.SetFileName("C:\\Excel");
m_ExcelEngine.BeginDoc();
m_ExcelEngine.TextOutRC
(5,5," Text in 5th row, 5th column", haCenter, ctString);
m_ExcelEngine.EndDoc();
How do I create a document with different page sizes and orientations?
[VB]
With gtEngineX1
.FileName = "C:\DiffPageSize"
' Page Settings for 1st Page
.PagePaperSize = A4
.PageOrientation = poPortrait
.PageTopMargin = 0.5
.BeginDoc
.Font.Size = 14
.Font.Bold = True
.TextFormatting.BeforeSpace = 1
.TextFormatting.Alignment = haCenter
.BeginPara
.TextOut "This text is on an A4 size page with Portrait orientation"
.EndPara
' Page Settings for 2nd Page
' *** 2nd Page: A5, Landscape
.PagePaperSize = A5
.PageOrientation = poLandscape
.NewPage
.TextFormatting.BeforeSpace = 1
.TextFormatting.Alignment = haCenter
.BeginPara
.TextOut "This text is on an A5 size page with Landscape orientation"
.EndPara
.EndDoc
End With
[VC++]
m_Engine.SetFileName("C:\\DiffPageSize");
/* Page Settings for 1st Page */
m_Engine.SetPagePaperSize(A4);
m_Engine.SetPageOrientation(poPortrait);
m_Engine.SetPageTopMargin(0.5);
m_Engine.BeginDoc();
COleFont F = m_Engine.GetFont();
CY fontsize = m_Engine.GetFont().GetSize();
fontsize.int64 = 140000;
F.SetSize(fontsize);
F.SetBold(true);
CgtTextFormattingX txtFormatting;
txtFormatting = m_Engine.GetTextFormatting();
txtFormatting.SetBeforeSpace(1);
txtFormatting.SetAlignment(haCenter);
m_Engine.BeginPara();
m_Engine.TextOut
("This text is on an A4 size page with Portrait orientation");
m_Engine.EndPara();
/* Page Settings for 2nd Page */
/* *** 2nd Page: A5, Landscape */
m_Engine.SetPagePaperSize(A5);
m_Engine.SetPageOrientation(poLandscape);
m_Engine.NewPage();
m_Engine.BeginPara();
m_Engine.TextOut
("This text is on an A5 size page with Landscape orientation");
m_Engine.EndPara();
m_Engine.EndDoc();
|