Export to PDF

H

Humphrey

I'm trying to use the Export to PDF function in InfoPath 2007. The file is
exported but the page layout is lost. That is to say the top and left
margins have disappeared and the individual pages are truncated at the last
piece of text (all the whitespace chopped off the top, left and bottom).
How do I tweak the settings on this facility? At the moment I have to
reprint everything to via Acrobat 7 to get a standard page size. The printed
pages are then centred in the page instead of top aligned as in the original
layout.
It is so close but I'm lost here. Help? Anyone?

H
 
A

Alan Cossey

Hello, Humphrey,
I note that you got no replies to your question. Did you ever work out how
to do it as I am now in the same situation as you. The export code seems to
allow for no setting of any page parameters. The code I am using is as
follows (strFileName is the file name returned from a SaveFileDialog)

CurrentView.Export(strFileName, ExportFormat.Pdf)

Cheers,

Alan Cossey
 
H

Humphrey

Alan,

No luck as yet. Could ask your indulgence to answer me one question? I
keep getting errors telling me that ".Export is not a member of CurrentView".
How did you get around this issue? I'm good with VBA but this InfoPath
scripting has me bamboozled.

H
 
A

Alan Cossey

Hiya. Yes, I'm a VBA man too!
I'm using VSTA with VB as the language and have the following declared at
the top of the form code:

Imports Microsoft.Office.InfoPath
Imports System
Imports System.Windows.Forms
Imports System.Xml
Imports System.Xml.XPath
Imports mshtml
Imports System.io

All except the System.io were automatically generated and it is from
Microsoft.Office.InfoPath that CurrentView is descended (or whatever the .NET
jargon is). What happens if you type in
"Microsoft.Office.InfoPath.CurrentView." with the period/full stop on the
end? Does intellisense suggest Export as a method to you? What happens if you
select the word CurrentView and you hit F2?
 
H

Humphrey

Alan,

That's the bit I'm missing. Both yield no results. Is there a
reference I need to set? Is there a manual tweak to point to the Export
routine? I can see what the issue is I just cannot correct it

H
 
A

Alan Cossey

This is really a case of the blind leading the blind here, but if you would
like to zip up your file and send it to me at
(e-mail address removed) I'll have a look at it. Would that help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top