Setting PDF file properties

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.
Post Reply
mdaniloff
Posts: 4
Joined: Wed Sep 07 2005

Setting PDF file properties

Post by mdaniloff »

We're trying to empty existing PDF file properties. here is our code snippet.

If the resulted PDF file is opened on a machine without Adobe Writer the properties are empty.


But the original properties are still visible if the document is opened on a computer with Adobe Writer (Distiller) installed.

Please advise.

Thanks,

---------------------------------------------------------

Option Explicit
Dim oPDFEx As Object
Dim oPDFDOC As Object

Private Sub Command1_Click()
Dim sFileName As String
Dim sFileOut As String

On Error GoTo bye

Dim lOpened As Long
Set oPDFEx = CreateObject("CDIntfEx.CDIntfEx")


With oPDFEx
.DriverInit ("ACME PDF Printer")
.SetDefaultPrinter
.FileNameOptionsEx = &H1 + &H2 + &H100000
.DefaultFileName = sFileOut 'Set PDF name
End With

oPDFEx.EnablePrinter "ACME, Inc.", "lic number here"

Set oPDFDOC = CreateObject("CDIntfEx.Document")


sFileName = "C:\Test\edited.pdf"
sFileOut = "C:\Test\out.pdf"

lOpened = oPDFDOC.Open(sFileName)

With oPDFDOC

.Author = " "
.Title = " "
.Subject = " "
.KeyWords = ""
.Creator = " "
.Save sFileOut
End With

oPDFEx.FileNameOptionsEx = 0
' close the printer handle and remove printer
oPDFEx.DriverEnd

'Unload Me
Exit Sub

bye:
MsgBox Err.Number

End Sub
Post Reply