Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Content Groups
Collapse All

This method adds an optional content group to an order.

Syntax

HRESULT AddContentGroup (
LONG groupIndex
)
Parameters
groupIndex
Index of the content group

Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.

Remarks

The BeginOrder method must be called before AddContentGroup.

Example

Creating a Named Order for Content Groups

C/C++
[copy to clipboard]
// PDF object is supposed to be created

// Create 1st content group
size_t backgroungGroup = PDF.CreateContentGroup(L"Background");
PDF.BeginMarkedContent(backgroungGroup);
PDF.EndMarkedContent();

// Create 2nd content group
size_t textGroupIndex = PDF.CreateContentGroup(L"Text Optional Content Group");
PDF.BeginMarkedContent(textGroupIndex);
PDF.EndMarkedContent();

// Create 3rd content group 
size_t imageGroupIndex = PDF.CreateContentGroup(L"Logo (Two Pilots)");
PDF.BeginMarkedContent(imageGroupIndex );
PDF.EndMarkedContent();

// Create 4th content group 
size_t copyrightGroupIndex = PDF.CreateContentGroup(L"Copyright");
PDF.BeginMarkedContent(copyrightGroupIndex);
PDF.EndMarkedContent();

// Create order with embedded groups
doc.BeginOrder(L"Order 1");
PDF.AddContentGroup(backgroungGroup);
PDF.AddContentGroup(textGroupIndex);

PDF.BeginOrder(L"Order 2");
PDF.AddContentGroup(imageGroupIndex);
PDF.AddContentGroup(copyrightGroupIndex);
PDF.EndOrder(); 

PDF.EndOrder();
Delphi
[copy to clipboard]
{ PDF object is supposed to be created }

{ Create 1st content group }
size_t backgroungGroup := PDF.CreateContentGroup('Background');
PDF.BeginMarkedContent(backgroungGroup);
PDF.EndMarkedContent();

{ Create 2nd content group }
size_t textGroupIndex := PDF.CreateContentGroup('Text Optional Content Group');
PDF.BeginMarkedContent(textGroupIndex);
PDF.EndMarkedContent();

{ Create 3rd content group }
size_t imageGroupIndex := PDF.CreateContentGroup('Logo (Two Pilots)');
PDF.BeginMarkedContent(imageGroupIndex );
PDF.EndMarkedContent();

{ Create 4th content group }
size_t copyrightGroupIndex := PDF.CreateContentGroup('Copyright');
PDF.BeginMarkedContent(copyrightGroupIndex);
PDF.EndMarkedContent();

{ Create order with embedded groups }
doc.BeginOrder('Order 1');
PDF.AddContentGroup(backgroungGroup);
PDF.AddContentGroup(textGroupIndex);

PDF.BeginOrder('Order 2');
PDF.AddContentGroup(imageGroupIndex);
PDF.AddContentGroup(copyrightGroupIndex);
PDF.EndOrder(); 

PDF.EndOrder();
C#
[copy to clipboard]
// PDF object is supposed to be created

// Create 1st content group
size_t backgroungGroup = PDF.CreateContentGroup("Background");
PDF.BeginMarkedContent(backgroungGroup);
PDF.EndMarkedContent();

// Create 2nd content group
size_t textGroupIndex = PDF.CreateContentGroup("Text Optional Content Group");
PDF.BeginMarkedContent(textGroupIndex);
PDF.EndMarkedContent();

// Create 3rd content group 
size_t imageGroupIndex = PDF.CreateContentGroup("Logo (Two Pilots)");
PDF.BeginMarkedContent(imageGroupIndex );
PDF.EndMarkedContent();

// Create 4th content group 
size_t copyrightGroupIndex = PDF.CreateContentGroup("Copyright");
PDF.BeginMarkedContent(copyrightGroupIndex);
PDF.EndMarkedContent();

// Create order with embedded groups
doc.BeginOrder("Order 1");
PDF.AddContentGroup(backgroungGroup);
PDF.AddContentGroup(textGroupIndex);

PDF.BeginOrder("Order 2");
PDF.AddContentGroup(imageGroupIndex);
PDF.AddContentGroup(copyrightGroupIndex);
PDF.EndOrder(); 

PDF.EndOrder();
Visual Basic Script
[copy to clipboard]
' PDF object is supposed to be created 

' Create 1st content group 
size_t backgroungGroup = PDF.CreateContentGroup("Background")
PDF.BeginMarkedContent backgroungGroup
PDF.EndMarkedContent

' Create 2nd content group 
size_t textGroupIndex = PDF.CreateContentGroup("Text Optional Content Group")
PDF.BeginMarkedContent textGroupIndex
PDF.EndMarkedContent

' Create 3rd content group 
size_t imageGroupIndex = PDF.CreateContentGroup("Logo (Two Pilots)")
PDF.BeginMarkedContent imageGroupIndex
PDF.EndMarkedContent

' Create 4th content group 
size_t copyrightGroupIndex = PDF.CreateContentGroup("Copyright")
PDF.BeginMarkedContent copyrightGroupIndex
PDF.EndMarkedContent

' Create order with embedded groups 
doc.BeginOrder("Order 1")
PDF.AddContentGroup backgroungGroup
PDF.AddContentGroup textGroupIndex

PDF.BeginOrder("Order 2")
PDF.AddContentGroup imageGroupIndex
PDF.AddContentGroup copyrightGroupIndex
PDF.EndOrder 

PDF.EndOrder

See Also

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots