Text object spanning multiple pages in a PDF file

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
Jagannath
Posts: 6
Joined: Wed Jul 19 2006

Text object spanning multiple pages in a PDF file

Post by Jagannath »

Hi,

I'm using PDF creator 2.0 which comes with the demo suite.

In a multi page PDF file, there is a Text object by name "TextA" at bottom position of the page.
I want to add another Text object by name "TextB" below the object "TextA".
"TextB" object has large data spanning multiple lines (say 100 lines). TextB has to extend to next page, as it has large volume of data in it.


Below is sample code given I am working on:


.Open App.Path & "\" & "Sample_TextObj.pdf", "" ' open a sample PDF document

.ReportState = acReportStateDesign ' switch the control to design mode

'**Text object************
.CurrentPage = 1

' create a text to add to the document
.CreateObject acObjectTypeText, "Text1"
' text to display

'Throws an error while setting value to multiline
'.ObjectAttribute("Text1", "Singleline") = false


'.ObjectAttribute("Text1", "Text") = "Text Object"
.ObjectAttribute("Text1", "text") = strTextVal

' position the text
.ObjectAttribute("Text1", "Left") = 400
.ObjectAttribute("Text1", "Top") = 800
.ObjectAttribute("Text1", "Right") = 600
.ObjectAttribute("Text1", "Bottom") = 400
' set background color to yellow
.ObjectAttribute("Text1", "BackColor") = "7FFFFF"
'**Text object************

.Save App.Path & "\" & "Sample_TextObj_1.pdf", 0 ' save the modified document


Please clarify the queries given below:
(a) Is it possible to set multiline values spanning more than one page for a Text object.


(b) While setting "Singleline" attribute of Text object, it throws an error "method failed".
I know by default Singleline attribute is false. What is the way or method to set Text object Sinleline or multiline attribute?

(c) Is it possible to add a hidden Text object in a PDF file?


Thanks and Regards
Jagannath
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,


1- No, it is not possible to span an object over two pages.

2- The situation you are encountering occurs because you are using the incorrect attribute. You should use "Single Line"

.Attribute("Single Line") = True

3- If you wish to control whether or not an object is displayed in the PDF Creator, you will need to its Annotation attribute to true and set Hidden attribute to the appropriate value.

I have included a code snippet below which illustrates this.

.Attribute("Annotation") = True

'////////////////////////////////////

'Hide or Show annotation depending on

'mode

'Hidden

'1: Hide in Run mode

'2: Hide in Design mode

'8: Hide in PrintPreview mode

'16: Hide in Annotation mode

'255: Always Hide



.Attribute("Hidden") = 8

Hope this helps?
Post Reply