VB6 - Word - Legal Size Issues

If you are a VB developer and have questions about using our products from VB, here is the place to post them.

VB6 - Word - Legal Size Issues

Postby agilysys on Mon Nov 17 2008

Hi I'm, in need of sending multiple Legal size Word documents to a single PDF. I have purchased Amyuni 3.0, developer edition and have read numerous posts along with the Common Driver Interface 300 doc. I'll get to the point. No matter what I try I can't get the PDF to capture and display the entire legal size document. I've tried everything from PaperSize = 5 to PaperSize = 256 with the correcsponding settings such as PaperWidth and PaperHeight. No matter, it always displays as 8 1/2 by 11. Originally, Word would give me an "outside the margins" error. After looking at the post by mike1174 from Nov 8 2005, I copied some of that code and now I no longer get the error, but it still prints 8 1/2 by 11. As is common, I have a tight deadline and I really need a hand. Any advice would be appreciated. Here is the basic code I've tried which does not give the Word error, but also does not send the complete document to PDF. Thanks in advance


Private Sub Command2_Click()
Dim appWD As Object
Dim pdf As Object
Dim PDFPrinter$
Dim doc As Object

PDFPrinter = "My PDF Converter"
Set pdf = CreateObject("CDIntfEx.CDIntfEx")

Set appWD = Nothing
Set appWD = CreateObject("Word.application.8")

Set doc = appWD.Documents.Open(FileName:="C:\Amyuni Test Program\Test BEO File.doc")

' Printer initialization
pdf.PDFDriverInit (PDFPrinter)
pdf.EnablePrinter strLicenseTo, strActivationCode
' ***** Printing a Word document to PDF *****

' Set file name options
pdf.FileNameOptionsEx = 1 + 2
pdf.PaperSize = 5
pdf.SetDefaultConfig
pdf.DefaultFileName = "c:\amyuni test program\test.pdf"

' Enable the printer before each printout
pdf.EnablePrinter strLicenseTo, strActivationCode

doc.Application.ActivePrinter = PDFPrinter

' Print the Word document (concatenated to the first pdf file)
doc.PrintOut Background:=False

' Reset 0ptions to zero
pdf.FileNameOptions = 0

pdf.DriverEnd

Set pdf = Nothing
Set doc = Nothing
appWD.quit
Set appWD = Nothing

End Sub
agilysys
 
Posts: 3
Joined: Fri Nov 14 2008

Re: VB6 - Word - Legal Size Issues

Postby Joan on Tue Nov 18 2008

Hello,

What is the page setting of the original Word document?

I tried to print a legal word document to the PDF Printer and whether i set the printer page settings to legal or not i get a legal size PDF file 8.5 x 14 inches.

I made my test using the UI of the PDF Printer and not programatically. I used version 3.03 of the PDF Converter
[size=150][color=#FF0000]Custom Brand the Amyuni PDF Printer Driver [/color][/size][color=#000080]http://www.amyuni.com/en/developer/branding/index.html[/color]

Amyuni PDF Converter tested for true PDF performance. View results - [color=#0040FF]http://www.amyuni.com/benchmark[/color]
Joan
Amyuni Team
 
Posts: 2799
Joined: Wed Sep 11 2002

Re: VB6 - Word - Legal Size Issues

Postby agilysys on Tue Nov 18 2008

The page in Word is set to legal. I'm not going to be able to use the UI as this must be a batch process done programmatically. Thanks for your response though. :)
agilysys
 
Posts: 3
Joined: Fri Nov 14 2008

Re: VB6 - Word - Legal Size Issues

Postby David on Tue Nov 18 2008

Hello

1) Can you try the latest 3.03 that is available on our site?

2) Try setting the printer margins to zero when printing e.g.

' Printer initialization
pdf.PDFDriverInit (PDFPrinter)
pdf.EnablePrinter strLicenseTo, strActivationCode
' ***** Printing a Word document to PDF *****


pdf.VerticalMargin = 0
pdf.HorizontalMargin = 0

pdf.PaperSize = 5
pdf.SetDefaultConfig
pdf.DefaultFileName = "c:\amyuni test program\test.pdf"

' Set file name options
pdf.FileNameOptionsEx = 1 + 2

' Enable the printer before each printout
pdf.EnablePrinter strLicenseTo, strActivationCode

Hope that helps

David
[size=110][color=#FF0000]Amyuni Custom Development[/color][/size]
Do you need a specific PDF solution? Are you looking for expertise that will enable you to start or complete a PDF integration project?
[url]http://www.amyuni.com/en/company/services.php[/url]
David
Amyuni Team
 
Posts: 89
Joined: Mon Dec 18 2006

Re: VB6 - Word - Legal Size Issues

Postby agilysys on Tue Nov 18 2008

I just purchased it a couple of days ago. I checked cdintf.dll and it says 3.0.3. Isn't this the most recent? I did try your idea about the margins to no avail. Thanks for the reply.
agilysys
 
Posts: 3
Joined: Fri Nov 14 2008


Return to Visual Basic Community

Who is online

Users browsing this forum: No registered users and 1 guest

cron