The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
I have following VBA in Microsoft Word 2010 and OS is Windows 8(CDINTF 2.5.1.4)
When it prints I get "65535 Error opening PDF Document" error always.
But there is no problem in Windows 7.
What may be the reason for this?
Amyuni PDF Converter 4.5 is the result of more than a year of continual improvements over the previous 4.0 release. With Windows 7 and 64-bit OS becoming the standards in the PC market, all the aspects of running under these environments have been reviewed and optimized.
We have ran internal testing for Windows 8 (Release Preview) to get Microsoft certification using the Windows Hardware Certification Kit and the tests went well. http://msdn.microsoft.com/library/windo ... e/br259114
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - http://www.amyuni.com
Sub PDFPrint()
Dim strActivePrinterMemory As String
Dim cdiPDFPrinter As Object
Dim docPDF As Object
Const PDF_DRIVER_NAME = "QASPDFPrinter"
Const PDF_FILE_PRINT_OPTION_RESET = 0
Const PDF_FILE_PRINT_OPTION_NO_PROMPT = 1
Const PDF_FILE_PRINT_OPTION_USE_FILE_NAME = 2
Const PDF_FILE_PRINT_OPTION_CONCATENATE = 4
Const PDF_FILE_PRINT_OPTION_DISABLE_COMPRESSION = 8
Const PDF_FILE_PRINT_OPTION_EMBED_FONTS = 16
Const PDF_FILE_PRINT_OPTION_BROADCAST_MESSAGES = 32
Const PDF_PAPER_SIZE_A4 = 9
Const PDF_PAPER_ORIENTATION_PORTRAIT = 1
Const PDF_PERM_OWNER_PASSWORD = "Test"
Const PDF_PERM_USER_ALLOW_PRINTING = &H4
Const PDF_PERM_USER_ALLOW_CHANGING_DOC = 8
Const PDF_PERM_USER_ALLOW_COPYING = 16
Const PDF_PERM_USER_ALLOW_NOTES = &H32
Const PDF_COMP_256_COLOUR = &H800000
Const pdf_AmyuniLicenseCompany = "Amyuni Technologies Eval Version"
Const pdf_AmyuniLicenseCode = "07EFCDAB0100010031825101B257659266255C64F543DF28853EEACF7AFD9DC81D66B62926B87CEC1161728458C731CE6C2429A6B440"
On Error GoTo Err_PDFPrint
'Initialise PDF printer
Set cdiPDFPrinter = CreateObject("CDIntfEx.CDIntfEx.4.5")
With cdiPDFPrinter
.DriverInit PDF_DRIVER_NAME
'Set margins to zero
.HorizontalMargin = 0
.VerticalMargin = 0
.SetDefaultConfig
'Set paper size & orientation
.PaperSize = PDF_PAPER_SIZE_A4
.Orientation = PDF_PAPER_ORIENTATION_PORTRAIT
End With
'Set PDF printer
strActivePrinterMemory = Application.ActivePrinter
If Not CBool(InStr(1, Application.ActivePrinter, PDF_DRIVER_NAME, vbTextCompare)) Then
Application.ActivePrinter = PDF_DRIVER_NAME
End If
'Print doc to PDF
With cdiPDFPrinter
.EnablePrinter pdf_AmyuniLicenseCompany, pdf_AmyuniLicenseCode
'Set PDF page file name
.DefaultFileName = "C:\\TestPDF\\TestPDF.PDF"
'Set options
.FileNameOptionsEx = PDF_FILE_PRINT_OPTION_NO_PROMPT + PDF_FILE_PRINT_OPTION_USE_FILE_NAME + PDF_FILE_PRINT_OPTION_DISABLE_COMPRESSION
.FileNameOptions = PDF_FILE_PRINT_OPTION_NO_PROMPT + PDF_FILE_PRINT_OPTION_USE_FILE_NAME + PDF_FILE_PRINT_OPTION_DISABLE_COMPRESSION
.EnablePrinter pdf_AmyuniLicenseCompany, pdf_AmyuniLicenseCode
'Print doc to PDF file
ActiveDocument.PrintOut
'Reset FileNameOptions
.FileNameOptionsEx = PDF_FILE_PRINT_OPTION_RESET
End With
Exit_PDFPrint:
On Error GoTo 0
Exit Sub
Err_PDFPrint:
Set docPDF = Nothing
Set cdiPDFPrinter = Nothing
Select Case Err.Number
Case Else:
MsgBox Err.Number & "-" & Err.Description, vbCritical + vbOKOnly, "Error message"
End Select
Resume Exit_PDFPrint
End Sub
I installed Amyuni PDF Converter 4.5 and tried above coding.
It creates C:\\TestPDF\\TestPDF.PDF file but size is 0bytes.
Since my old Amyuni 2.5 works in Windows 7 with Office 2010 but latest Amyuni doesn’t work in Windows 8 with Office 2010.
Is there anything to change in Windows 8?
1. ensure on a 64-bit PC that the PDF printer is assigned to the NUL: port
2. change to "Print directly to the printer" under Printer properties | Advanced tab.
You may consider taking off "Broadcast messages".
Hope this helps.
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - http://www.amyuni.com
On another note, using the Amyuni PDF Converter developer edition to create a MsWord macro is not supported in the standard developer\application license. http://www.amyuni.com/en/developer/devlicense/
Thanks
Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite