Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).

New Forum | Previous | Next | (P-PDF) Developers

Topic: Printing Form Text Boxes Generated in Visual Basic
Conf: (P-PDF) Developers, Msg: 34645
From: ao730
Date: 2/12/2002 08:55 PM

I thought I posted this yesterday, but I'm not seeing it on the list. I have a routine that takes multiple pdfs generated using distiller (Adobe 4.0) and combines them into one pdf. A second routine then adds page numbers to the report in the form of text boxes. When the resulting pdf is viewed on screen the page numbers are clearly visible, however when the pdf is printed the page numbers are missing. I've checked the properties, and they indicate that they are set to visible, which should enable them to be printed. I've found that if I touch each form text box and move it slightly they will print afterward. Anyone have any idea what I might be missing?

Here's the code I run for generating the text boxes:

Private Sub Command1_Click()
Dim Exch As Acrobat.CAcroApp
Dim PDDoc As Acrobat.CAcroPDDoc
Dim AVDoc As Acrobat.CAcroAVDoc
Dim PDPageView As Acrobat.CAcroAVPageView
Dim PDPage As Acrobat.CAcroPDPage
Dim Points As Acrobat.CAcroPoint
Dim Field As AFORMAUTLib.Field
Dim filename As String
Dim strFieldName As String
Dim strFieldValue As String

cdBox.Filter = "Adobe (*.pdf) | *.pdf"
filename = cdBox.filename

Set Exch = CreateObject("AcroExch.APP")
Set AVDoc = CreateObject("AcroExch.AVDoc")
Set PDDoc = CreateObject("AcroExch.PDDoc")

AVDoc.Open filename, ""

Set AFormAut = CreateObject("AFormAut.App")
Set Fields = AFormAut.Fields
Set PDDoc = AVDoc.GetPDDoc
Set PDPageView = AVDoc.GetAVPageView

For Loopy = 1 To (PDDoc.GetNumPages - 1)
PDPageView.GoTo (Loopy)

Set PDPageView = AVDoc.GetAVPageView
Set PDPage = PDPageView.GetPage
Set Points = PDPage.GetSize
Set Field = Fields.Add("Page" & Loopy, "text", Loopy, Points.x - 150, 120, Points.x - 75, 145)
'Field.IsHidden = True
'Field.PrintFlag = True

Field.TextSize = 10
Field.Value = "Page " & (Loopy + 1) & " of " & PDDoc.GetNumPages

Next Loopy
PDPageView.GoTo (0)
filename = cdBox.filename

Set PDDoc = AVDoc.GetPDDoc

PDDoc.Save PDSaveFull + PDSaveCollectGarbage, filename
AVDoc.Close True
Set PDDoc = Nothing
Set AVDoc = Nothing
Set Exch = Nothing

End Sub

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.