원본 : http://acrobat-dde.nnn2.com/?p=36
PDF파일을 읽고 페이지 삽입 또는 삭제 작업 처리후 다른 파일로 재저장 하기 위한 용도
Specified PDF file is preserved by the alias naming the name. Preservation to PDF file on the same name comes. When preserving it, the optimization of PDF file (reduction of the size) is done.
It doesn’t operate in Acrobat Reader.
Syntax
[DocSaveAs(char* fullPath, char* newPath)]
Argument
fullPath [char*] |
The full path in updated PDF file. It is necessary already to be opened by the Acrobat application. |
newPath [char*] |
The Full path in the new PDF file. |
Returns
true | The pages are saved successfully. |
false | Otherwise. |
Notes: The return value cannot be acquired with DDE of VBA of Excel.
Sample: VBA of Excel
Specified PDF file is preserved and the name is preserved by the alias putting it.
・Please confirm the test by the step execution with F8 key.
Sub DDE_DocSaveAs()
Dim lChanNo As Long ‘DDE channel number
Const CON_PDF_PATH = “”"E:\Test01.pdf”"”
‘The Acrobat application is Started.
Shell “C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe”
‘Open of DDE channel
lChanNo = DDEInitiate(“Acroview”, “Control”)
‘Open of PDF file
DDEExecute lChanNo, “[DocOpen(" & CON_PDF_PATH & ")]“
‘Deletion of page (deletion of 2, 3, and page 4)
DDEExecute lChanNo, “[DocDeletePages(" & CON_PDF_PATH & ",1,3)]“
‘Saves an the PDF file to a new path.。
DDEExecute lChanNo, “[DocSaveAs(" & _
CON_PDF_PATH & "," & """E:\Test02A.pdf""" & ")]“
‘The Acrobat applicaton is ended..
DDEExecute lChanNo, “[AppExit()]“ ‘If this is not done, the Acrobat process remains.
‘The DDE channel is shut.
DDETerminate lChanNo
End Sub
Execution result
It is a result of the comparison on page thumbnail screen of Acrobat.
Deletion of page (deletion of 2, 3, and page 4).
Before |
After |
・It doesn’t operate in Acrobat Reader.
・The difference with DocSave is two points. The alias can be preserved. It is optimized.
Environment to confirm the operation
・WindowsXP + SP3 + WindowsUpdate
・Adobe Acrobat Pro 7.0.8 + Office Pro 2003
・Adobe Acrobat Pro 9.1.0 + Office Pro 2003
'프로그래밍 > Delphi' 카테고리의 다른 글
델파이에서 TStoredProcedure의 CreateParameter 사용시 주의점 (0) | 2010.01.18 |
---|---|
작업관리자에만 나타나는 프로세스 강제로 종료하기 (1) | 2009.12.21 |
xnView:GFL_SDK GFL_BITMAP을 TBitmap으로 복사 (2) | 2009.12.04 |
xnView:GFL_SDK Bitmap을 Gfl_Bitmap으로 변환(메모리 방식) (0) | 2009.12.04 |
xnView-GFL_SDK : 메모리를 이용한 데이터 복사(gflSaveBitmapIntoMemory) 참고자료 (0) | 2009.12.04 |