ImportDataWindow

Imports data from a DataWindow object, a DataWindowChild object or a DataStore object to a PDF document.

For DataWindow objects

To import data

Use

To the end of the PDF document

Syntax 1

Before the specified position of the PDF document

Syntax 2


For DataWindowChild objects

To import data

Use

To the end of the PDF document

Syntax 3

Before the specified position of the PDF document

Syntax 4


For DataStore objects

To import data

Use

To the end of the PDF document

Syntax 5

Before the specified position of the PDF document

Syntax 6


Syntax 1: for importing DataWindow to PDFDocument

Description

Imports data from a DataWindow object to a PDF document. All pages are added to the end of the PDF document. The PDF output is the same as you save data from a DataWindow object to a PDF document using PDFlib or GhostScript (depending on which one is set as the default method).

Applies to

PDFDocument object

Syntax

objectname.ImportDataWindow (DataWindow dw)

Argument

Description

objectname

The name of the PDFDocument object in which you want to import data from a DataWindow object to a PDF document

dw

The DataWindow object whose data is imported to a PDF document


Return value

Long.

Returns 1 if the function succeeds and a negative value if an error occurs. For more errors, see the Error Codes.

Examples

This statement imports all pages from the DataWindow object dw_1 and saves the contents to a PDF document called datawindow.pdf:

PDFDocument lpdf_doc
long ll_return,ll_return1

lpdf_doc = Create PDFDocument

ll_return = lpdf_doc.importdatawindow( dw_1)
ll_return1 = lpdf_doc.save( "D:\datawindow.pdf")

destroy lpdf_doc

This statement uses Modify to set the PDF standard, and then imports all pages from the DataWindow object dw_1 and saves the contents to a PDF document called datawindow1.pdf using PDFA_1A! standard:

PDFDocument lpdf_doc
long ll_return,ll_return1

lpdf_doc = Create PDFDocument

dw_1.Modify ("DataWindow.Export.PDF.Method = NativePDF! ")
dw_1.modify("DataWindow.Export.PDF.NativePDF.PDFStandard =1")

ll_return = lpdf_doc.importdatawindow( dw_1)
ll_return1 = lpdf_doc.save( "D:\datawindow1.pdf",PDFA_1A!)

destroy lpdf_doc

See also

ImportPDF

Save

Syntax 2: for importing DataWindow to PDFDocument

Description

Imports data from a DataWindow object to a PDF document. All pages are inserted before the specified position of the PDF document, and if the index of the specified position is out of range, the pages are added to the end. The PDF output is the same as you save data from a DataWindow object to a PDF document using PDFlib or GhostScript (depending on which one is set as the default method).

Applies to

PDFDocument object

Syntax

objectname.ImportDataWindow (DataWindow dw, long targetIndex)

Argument

Description

objectname

The name of the PDFDocument object in which you want to import data from a DataWindow object to a PDF document

dw

The DataWindow object whose data is imported to a PDF document

targetIndex

The target index of a PDF document before which you want to import all pages from a DataWindow object


Return value

Long.

Returns 1 if the function succeeds and a negative value if an error occurs. For more errors, see the Error Codes.

Example 1

This statement imports all pages from the DataWindow object dw_1 before the first page of a PDF document and saves the document as datawindow2.pdf.

PDFDocument lpdf_doc
long ll_return,ll_return1

lpdf_doc = Create PDFDocument

ll_return = lpdf_doc.importdatawindow( dw_1,1)
ll_return1 = lpdf_doc.save( "D:\datawindow2.pdf")

destroy lpdf_doc

See also

ImportPDF

Save

Syntax 3: for importing DataWindowChild to PDFDocument

Description

Imports data from a DataWindowChild object to a PDF document. All pages are added to the end of the PDF document. The PDF output is the same as you save data from a DataWindow object to a PDF document using PDFlib or GhostScript (depending on which one is set as the default method).

Applies to

PDFDocument object

Syntax

objectname.ImportDataWindow (DataWindowChild dwc)

Argument

Description

objectname

The name of the PDFDocument object in which you want to import data from a DataWindowChild object to a PDF document

dwc

The DataWindowChild object whose data is imported to a PDF document


Return value

Long.

Returns 1 if the function succeeds and a negative value if an error occurs. For more errors, see the Error Codes.

Examples

This statement imports all pages from the DataWindowChild object ldwc_child and saves the contents to a PDF document called datawindowchild.pdf:

DataWindowChild ldwc_child
PDFDocument lpdf_doc
long ll_return,ll_return1

lpdf_doc = Create PDFDocument
dw_2.settransobject( sqlca)
dw_2.retrieve( )
dw_2.getchild( "lname",ldwc_child)

ll_return = lpdf_doc.importdatawindow( ldwc_child)
ll_return1 = lpdf_doc.save("D:\datawindowchild.pdf" )

destroy lpdf_doc

This statement uses Modify to set the PDF standard, and then imports all pages from the DataWindowChild object ldwc_child and saves the contents to a PDF document called datawindowchild2.pdf using PDFA_1B! standard:

DataWindowChild ldwc_child
PDFDocument lpdf_doc
long ll_return,ll_return1

lpdf_doc = Create PDFDocument
//dw_2 is an object with DropDownDW edit style 
dw_2.settransobject( sqlca)
dw_2.retrieve( )
dw_2.getchild( "lname",ldwc_child)

ldwc_child.Modify ("DataWindow.Export.PDF.Method = NativePDF! ")
ldwc_child.modify("DataWindow.Export.PDF.NativePDF.PDFStandard =2")

ll_return = lpdf_doc.importdatawindow( ldwc_child)
ll_return1 = lpdf_doc.save("D:\datawindowchild2.pdf",PDFA_1B! )

destroy lpdf_doc

See also

ImportPDF

Save

Syntax 4: for importing DataWindowChild to PDFDocument

Description

Imports data from a DataWindowChild object to a PDF document. All pages are inserted before the specified position of the new PDF document, and if the index of the specified position is out of range, the pages are added to the end. The PDF output is the same as you save data from a DataWindow object to a PDF document using PDFlib or GhostScript (depending on which one is set as the default method).

Applies to

PDFDocument object

Syntax

objectname.ImportDataWindow (DataWindowChild dwc, long targetIndex)

Argument

Description

objectname

The name of the PDFDocument object in which you want to import data from a DataWindowChild object to a PDF document

dwc

The DataWindowChild object whose data is imported to a PDF document

targetIndex

The target index of a PDF document before which you want to import all pages from a DataWindowChild object


Return value

Long.

Returns 1 if the function succeeds and a negative value if an error occurs. For more errors, see the Error Codes.

Examples

This statement imports all pages from the DataWindowChild object ldwc_child before the first page of a PDF document and saves the document as datawindowchild.pdf:

DataWindowChild ldwc_child
PDFDocument lpdf_doc
long ll_return,ll_return1

lpdf_doc = Create PDFDocument
dw_2.settransobject( sqlca)
dw_2.retrieve( )
dw_2.getchild( "lname",ldwc_child)

ll_return = lpdf_doc.importdatawindow( ldwc_child,1)
ll_return1 = lpdf_doc.save("D:\datawindowchild.pdf" )

destroy lpdf_doc

See also

ImportPDF

Save

Syntax 5: for importing DataStore to PDFDocument

Description

Imports data from a DataStore object to a PDF document. All pages are added to the end of the PDF document. The PDF output is the same as you save data from a DataWindow object to a PDF document using PDFlib or GhostScript (depending on which one is set as the default method).

Applies to

PDFDocument object

Syntax

objectname.ImportDataWindow (DataStore ds)

Argument

Description

objectname

The name of the PDFDocument object in which you want to import data from a DataStore object to a PDF document

ds

The DataStore object whose data is imported to a PDF document


Return value

Long.

Returns 1 if the function succeeds and a negative value if an error occurs. For more errors, see the Error Codes.

Examples

This statement imports all pages from the DataStore object lds_1 and saves the contents to a PDF document called datastore.pdf:

DataStore lds_1
PDFDocument lpdf_doc
long ll_return,ll_return1

lpdf_doc = Create PDFDocument
lds_1 = Create DataStore
lds_1.dataobject = "d_emp"
lds_1.settransobject(sqlca)
lds_1.retrieve()

ll_return = lpdf_doc.importdatawindow( lds_1)
ll_return1 = lpdf_doc.save( "D:\datastore.pdf")

destroy lpdf_doc
destroy lds_1

This statement uses Modify to set the PDF standard, and then imports all pages from the DataStore object lds_1 and saves the contents to a PDF document called datastore2.pdf using PDFA-1A! standard:

DataStore lds_1
PDFDocument lpdf_doc
long ll_return,ll_return1

lpdf_doc = Create PDFDocument
lds_1 = Create DataStore
lds_1.dataobject = "d_emp"
lds_1.settransobject(sqlca)
lds_1.retrieve()

lds_1.Modify ("DataWindow.Export.PDF.Method = NativePDF! ")
lds_1.modify("DataWindow.Export.PDF.NativePDF.PDFStandard =1")

ll_return = lpdf_doc.importdatawindow( lds_1)
ll_return1 = lpdf_doc.save( "D:\datastore2.pdf",pdfa_1a!)

destroy lpdf_doc
destroy lds_1

See also

AddPage

Clone

GetPage

GetPageCount

GetTableOfContents

ImportPDF

ImportRichTextEdit

IndexOf

InsertPage

RemovePage

Save

SearchObject

SetTableOfContents

Syntax 6: for importing DataStore to PDFDocument

Description

Imports data from a DataStore object to a PDF document. All pages are inserted before the specified position of the PDF document, and if the index of the specified position is out of range, the pages are added to the end. The PDF output is the same as you save data from a DataWindow object to a PDF document using PDFlib or GhostScript (depending on which one is set as the default method).

Applies to

PDFDocument object

Syntax

objectname.ImportDataWindow (DataStore ds, long targetIndex)

Argument

Description

objectname

The name of the PDFDocument object in which you want to import data from a DataStore object to a PDF document

ds

The DataStore object whose data is imported to a PDF document

targetIndex

The target index of a PDF document before which you want to import all pages from a DataStore object


Return value

Long.

Returns 1 if the function succeeds and a negative value if an error occurs. For more errors, see the Error Codes.

Examples

This statement imports all pages from the DataStore object lds_1 before the first page of a PDF document and saves the document as datastore1.pdf:

DataStore lds_1
PDFDocument lpdf_doc
long ll_return,ll_return1

lpdf_doc = Create PDFDocument
lds_1 = Create DataStore
lds_1.dataobject = "d_emp"
lds_1.settransobject(sqlca)
lds_1.retrieve()

ll_return = lpdf_doc.importdatawindow( lds_1,1)
ll_return1 = lpdf_doc.save( "D:\datastore1.pdf")

destroy lpdf_doc
destroy lds_1

See also

AddPage

Clone

GetPage

GetPageCount

GetTableOfContents

ImportPDF

ImportRichTextEdit

IndexOf

InsertPage

RemovePage

Save

SearchObject

SetTableOfContents