New Forum | Previous | Next | (P-PDF) Developers
Topic: Will CropPages work from a vbs script?
Conf: (P-PDF) Developers, Msg: 80453
Date: 1/29/2003 11:45 PM
Hi, I'm trying to code a script in VBS to automatically crop a file, with no succes. The script don't throw any error but the page don't get cropped.
Could someone be so kind to take a look to the code and tell if I'm doing something wrong?
Thank in advance,
VBS Code begins->
Public Const PDSaveIncremental = &H0 ' write changes only
Public Const PDSaveFull = &H1 ' write entire file
Public Const PDSaveCopy = &H2 ' write copy w'o affecting current state
Public Const PDSaveLinearized = &H4 ' writes the file linearized for
' page-served remote (net) access.
Public Const PDSaveBinaryOK = &H10 ' /* OK to store binary in file */
Public Const PDSaveCollectGarbage = &H20 ' perform garbage collection on unreferenced objects ''
Dim PDDoc, FileIn, FileOut, Rect
Set PDDoc = CreateObject("AcroExch.PDDoc")
FileIn = "d:\mis documentos\cas.pdf"
FileOut = "d:\mis documentos\cas-1.pdf"
Set Rect = CreateObject("AcroExch.Rect")
Rect.Top = 1062
Rect.Bottom = 90
Rect.Left = 0
Rect.Right = 821
PDDoc.CropPages 0, 1, 0, Rect
PDDoc.Save PDSaveFull, FileOut
Set PDDoc = nothing
Set Rect = nothing
<- VBS Code ends