Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Test syntax coloring |
Post Reply |
Author | |
mLipok
Senior Member Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
Post Options
Thanks(0)
Posted: 23 Apr 15 at 7:52AM |
Func _QPDF_FileSplitEachPage($sPDF_FileFullPath, $sPDF_Password = '', $sDestinationDir = Default, $iNumberOfDigits = 3)
If $sDestinationDir = Default Then $sDestinationDir = @ScriptDir & '\Extracted' Local $oQP If _QPDF_CreateObjectAndUnlock($oQP) = 1 Then $oQP.LoadFromFile($sPDF_FileFullPath, $sPDF_Password) ; _QPDF_LastErrorCode($oQP) Local $iTotalPages = _QPDF_FileGetPageCount($sPDF_FileFullPath, '') Local $sPDF_Destination = '' If Not FileExists($sDestinationDir) Then DirCreate($sDestinationDir) Local $aPageFileList[$iTotalPages + 1] $aPageFileList[0] = $iTotalPages For $n = 1 To $iTotalPages $sPDF_Destination = $sDestinationDir & '\' & StringRegExp($sPDF_FileFullPath, '(?i).*\\(.*?)\.pdf', 3)[0] & '_p' &__QPDF_AddLeadingZeros(String($n), $iNumberOfDigits) & ".pdf" $aPageFileList[$n] = $sPDF_Destination $oQP.ExtractFilePages($sPDF_FileFullPath, '', $sPDF_Destination, $n) Next Return SetError(0, 0, $aPageFileList) Else Return SetError($__eQPDF_ERROR_DEBENULICENCE, 0, 0) EndIf EndFunc ;==>_QPDF_FileSplitEachPage |
|
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600 |
|
mLipok
Senior Member Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
Post Options
Thanks(0)
|
Func _QPDF_FileSplitEachPage($sPDF_FileFullPath, $sPDF_Password = '', $sDestinationDir = Default, $iNumberOfDigits = 3)
If $sDestinationDir = Default Then $sDestinationDir = @ScriptDir & '\Extracted' Local $oQP If _QPDF_CreateObjectAndUnlock($oQP) = 1 Then $oQP.LoadFromFile($sPDF_FileFullPath, $sPDF_Password) ; _QPDF_LastErrorCode($oQP) Local $iTotalPages = _QPDF_FileGetPageCount($sPDF_FileFullPath, '') Local $sPDF_Destination = '' If Not FileExists($sDestinationDir) Then DirCreate($sDestinationDir) Local $aPageFileList[$iTotalPages + 1] $aPageFileList[0] = $iTotalPages For $n = 1 To $iTotalPages $sPDF_Destination = $sDestinationDir & '\' & StringRegExp($sPDF_FileFullPath, '(?i).*\\(.*?)\.pdf', 3)[0] & '_p' &__QPDF_AddLeadingZeros(String($n), $iNumberOfDigits) & ".pdf" $aPageFileList[$n] = $sPDF_Destination $oQP.ExtractFilePages($sPDF_FileFullPath, '', $sPDF_Destination, $n) Next Return SetError(0, 0, $aPageFileList) Else Return SetError($__eQPDF_ERROR_DEBENULICENCE, 0, 0) EndIf EndFunc ;==>_QPDF_FileSplitEachPage |
|
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600 |
|
mLipok
Senior Member Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
Post Options
Thanks(0)
|
Func _QPDF_FileSplitEachPage($sPDF_FileFullPath, $sPDF_Password = '', $sDestinationDir = Default, $iNumberOfDigits = 3)
If $sDestinationDir = Default Then $sDestinationDir = @ScriptDir & '\Extracted' Local $oQP If _QPDF_CreateObjectAndUnlock($oQP) = 1 Then $oQP.LoadFromFile($sPDF_FileFullPath, $sPDF_Password) ; _QPDF_LastErrorCode($oQP) Local $iTotalPages = _QPDF_FileGetPageCount($sPDF_FileFullPath, '') Local $sPDF_Destination = '' If Not FileExists($sDestinationDir) Then DirCreate($sDestinationDir) Local $aPageFileList[$iTotalPages + 1] $aPageFileList[0] = $iTotalPages For $n = 1 To $iTotalPages $sPDF_Destination = $sDestinationDir & '\' & StringRegExp($sPDF_FileFullPath, '(?i).*\\(.*?)\.pdf', 3)[0] & '_p' &__QPDF_AddLeadingZeros(String($n), $iNumberOfDigits) & ".pdf" $aPageFileList[$n] = $sPDF_Destination $oQP.ExtractFilePages($sPDF_FileFullPath, '', $sPDF_Destination, $n) Next Return SetError(0, 0, $aPageFileList) Else Return SetError($__eQPDF_ERROR_DEBENULICENCE, 0, 0) EndIf EndFunc ;==>_QPDF_FileSplitEachPage |
|
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600 |
|
mLipok
Senior Member Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
Post Options
Thanks(0)
|
Func _QPDF_FileSplitEachPage($sPDF_FileFullPath, $sPDF_Password = '', $sDestinationDir = Default, $iNumberOfDigits = 3)
If $sDestinationDir = Default Then $sDestinationDir = @ScriptDir & '\Extracted' Local $oQP If _QPDF_CreateObjectAndUnlock($oQP) = 1 Then $oQP.LoadFromFile($sPDF_FileFullPath, $sPDF_Password) ; _QPDF_LastErrorCode($oQP) Local $iTotalPages = _QPDF_FileGetPageCount($sPDF_FileFullPath, '') Local $sPDF_Destination = '' If Not FileExists($sDestinationDir) Then DirCreate($sDestinationDir) Local $aPageFileList[$iTotalPages + 1] $aPageFileList[0] = $iTotalPages For $n = 1 To $iTotalPages $sPDF_Destination = $sDestinationDir & '\' & StringRegExp($sPDF_FileFullPath, '(?i).*\\(.*?)\.pdf', 3)[0] & '_p' &__QPDF_AddLeadingZeros(String($n), $iNumberOfDigits) & ".pdf" $aPageFileList[$n] = $sPDF_Destination $oQP.ExtractFilePages($sPDF_FileFullPath, '', $sPDF_Destination, $n) Next Return SetError(0, 0, $aPageFileList) Else Return SetError($__eQPDF_ERROR_DEBENULICENCE, 0, 0) EndIf EndFunc ;==>_QPDF_FileSplitEachPage |
|
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600 |
|
mLipok
Senior Member Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
Post Options
Thanks(0)
|
Func _QPDF_FileSplitEachPage($sPDF_FileFullPath, $sPDF_Password = '', $sDestinationDir = Default, $iNumberOfDigits = 3)
If $sDestinationDir = Default Then $sDestinationDir = @ScriptDir & '\Extracted' Local $oQP If _QPDF_CreateObjectAndUnlock($oQP) = 1 Then $oQP.LoadFromFile($sPDF_FileFullPath, $sPDF_Password) ; _QPDF_LastErrorCode($oQP) Local $iTotalPages = _QPDF_FileGetPageCount($sPDF_FileFullPath, '') Local $sPDF_Destination = '' If Not FileExists($sDestinationDir) Then DirCreate($sDestinationDir) Local $aPageFileList[$iTotalPages + 1] $aPageFileList[0] = $iTotalPages For $n = 1 To $iTotalPages $sPDF_Destination = $sDestinationDir & '\' & StringRegExp($sPDF_FileFullPath, '(?i).*\\(.*?)\.pdf', 3)[0] & '_p' &__QPDF_AddLeadingZeros(String($n), $iNumberOfDigits) & ".pdf" $aPageFileList[$n] = $sPDF_Destination $oQP.ExtractFilePages($sPDF_FileFullPath, '', $sPDF_Destination, $n) Next Return SetError(0, 0, $aPageFileList) Else Return SetError($__eQPDF_ERROR_DEBENULICENCE, 0, 0) EndIf EndFunc ;==>_QPDF_FileSplitEachPage |
|
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600 |
|
mLipok
Senior Member Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
Post Options
Thanks(0)
|
Func _QPdf_Example_HelloWorld()
Local $sFileName = @ScriptDir & "\hello-world.pdf" Local $oQP = ObjCreate($__sClassName) If __QPdf_UnlockKey($oQP, $__sLicenseKey) = 1 Then ;~ $oQP.AddPageLabels(1, 1, 10, '_QPdf_Example_HelloWorld()') $oQP.SetOrigin(1); $oQP.SetTextSize(20); $oQP.DrawText(100, 100, "Hello world from AutoIt") If $oQP.SaveToFile($sFileName) = 1 Then MsgBox($MB_SYSTEMMODAL, "Info", "File " & $sFileName & " written successfully.") Else MsgBox($MB_SYSTEMMODAL, "Error", "File " & $sFileName & " could not be written.") EndIf $aByteArray = $oQP.SaveToVariant() MsgBox($MB_SYSTEMMODAL, '$oQP.SaveToVariant()', VarGetType($aByteArray)) Local $fHandle = FileOpen($sFileName, 16 + 128) $aByteArray2 = FileRead($fHandle) FileClose($fHandle) MsgBox($MB_SYSTEMMODAL, 'Compare results:', $aByteArray = $aByteArray2) FileDelete(@ScriptDir & '\aByteArray.txt.') FileWrite(@ScriptDir & '\aByteArray.txt.', $aByteArray) FileDelete(@ScriptDir & '\aByteArray2.txt.') FileWrite(@ScriptDir & '\aByteArray2.txt.', $aByteArray2) EndIf EndFunc ;==>_QPdf_Example_HelloWorld Edited by mLipok - 28 Apr 15 at 2:25AM |
|
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600 |
|
mLipok
Senior Member Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
Post Options
Thanks(0)
|
Func _QPdf_Example_HelloWorld()
Local $sFileName = @ScriptDir & "\hello-world.pdf" Local $oQP = ObjCreate($__sClassName) If __QPdf_UnlockKey($oQP, $__sLicenseKey) = 1 Then ;~ $oQP.AddPageLabels(1, 1, 10, '_QPdf_Example_HelloWorld()') $oQP.SetOrigin(1); $oQP.SetTextSize(20); $oQP.DrawText(100, 100, "Hello world from AutoIt") If $oQP.SaveToFile($sFileName) = 1 Then MsgBox($MB_SYSTEMMODAL, "Info", "File " & $sFileName & " written successfully.") Else MsgBox($MB_SYSTEMMODAL, "Error", "File " & $sFileName & " could not be written.") EndIf $aByteArray = $oQP.SaveToVariant() MsgBox($MB_SYSTEMMODAL, '$oQP.SaveToVariant()', VarGetType($aByteArray)) Local $fHandle = FileOpen($sFileName, 16 + 128) $aByteArray2 = FileRead($fHandle) FileClose($fHandle) MsgBox($MB_SYSTEMMODAL, 'Compare results:', $aByteArray = $aByteArray2) FileDelete(@ScriptDir & '\aByteArray.txt.') FileWrite(@ScriptDir & '\aByteArray.txt.', $aByteArray) FileDelete(@ScriptDir & '\aByteArray2.txt.') FileWrite(@ScriptDir & '\aByteArray2.txt.', $aByteArray2) EndIf EndFunc ;==>_QPdf_Example_HelloWorld Edited by mLipok - 28 Apr 15 at 2:23AM |
|
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store