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!
![]() |
How to Split A4 into 2xA5 format |
Post Reply ![]() |
Author | |
mLipok ![]() Senior Member ![]() ![]() Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
![]() ![]() ![]() ![]() ![]() Posted: 26 Apr 14 at 12:50PM |
The question exactly how the topic:
How to Split A4 pdf File/page into 2xA5 format. EDIT: Iam using DebenuPDFLibraryAX1014.PDFLibrary Best regards mLipok Edited by mLipok - 26 Apr 14 at 12:55PM |
|
![]() |
|
mLipok ![]() Senior Member ![]() ![]() Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
![]() ![]() ![]() ![]() ![]() |
I managed it with my own.
I could not wait. But I'm counting on your help in the future. Edited by mLipok - 28 Apr 14 at 2:09AM |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi,
from time to time Debenu-members are looking and answering here, too. Mainly this is a user-user-forum. If you're counting on help you sometimes have to wait a few days. If there's nobody here with the same prob in the past there can't be an answer for you 'cause nobody will sit down to create a solution for you ;-) But the other way round: If i want to split a page into two smaller ones in the future... I'll see your headline of the post and open it 'cause i think there's a solution but i'll only find a "i managed it by my own" ;-) Perhaps you can post your own solution in the samples-section to help others? On the official Debenu-pages you'll find a lot of samples, FAQs, ... Cheers and welcome here, Ingo Edited by Ingo - 29 Apr 14 at 7:26AM |
|
Cheers,
Ingo |
|
![]() |
|
mLipok ![]() Senior Member ![]() ![]() Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
![]() ![]() ![]() ![]() ![]() |
Thanks for your answer.
Just wait a few days, and I post my solution for this problem. Becase I solve it my self. btw I know it's not 24/7/365 help line :) I am a member of the community AutoIt http://www.autoitscript.com/forum/user/10673-mlipok/ and have knowledge and understanding of netiquette for this, please bear with us in the future about my language skills. Best regards Michael Lipok (mLipok) |
|
![]() |
|
mLipok ![]() Senior Member ![]() ![]() Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
![]() ![]() ![]() ![]() ![]() |
"
I'll see your headline of the post and open it 'cause i think there's a solution but i'll only find a "i managed it by my own" ;-) Perhaps you can post your own solution in the samples-section to help others? " Here is my script ( I wrote it in AutoIt http://www.autoitscript.com/site/ ) : Func _QPDF_A4toA5() Local $oQP If _QPDF_CreateObjectAndUnlock($oQP) = 1 Then #Region create a A4 test PDF $oQP.SetPageSize('A4') $oQP.SetOrigin($__QPDF_SORIGIN_TopLeft); $oQP.SetMeasurementUnits($__QPDF_MUNITS_Milimeters) $oQP.SetTextSize(10); Local $iTableID = $oQP.CreateTable(2, 1); $oQP.SetTableColumnWidth($iTableID, 1, 1, $__QPDF_A4_WidthInMM); $oQP.SetTableRowHeight($iTableID, 1, 2, $__QPDF_A4_HeightInMM / 2); $oQP.SetTableCellBorderColor($iTableID, 1, 1, 2, 1, 0, 1, 0, 2); $oQP.SetTableCellBorderWidth($iTableID, 1, 1, 2, 1, $__QPDF_BORDERINDEX_All, 0.1); $oQP.SetTableCellTextSize($iTableID, 1, 1, 2, 1, 100) $oQP.SetTableCellAlignment($iTableID, 1, 1, 2, 1, $__QPDF_CELLALIGNMENT_MiddleCenter); $oQP.SetTableCellContent($iTableID, 1, 1, 'TOP') $oQP.SetTableCellContent($iTableID, 2, 1, 'BOTTOM') $oQP.DrawTableRows($iTableID, 0, 0, $__QPDF_A4_HeightInMM, 1, 2) $oQP.SaveToFile(@ScriptDir & '\A4_TEST.pdf'); #EndRegion create a A4 test PDF #Region Create New PDF File with 2* new A5 Landscape Page Local $iIDMainDocument = $oQP.SelectedDocument() $oQP.NewDocument() $oQP.CopyPageRanges($iIDMainDocument, '1') ; it is 2 page but will be first Page $oQP.SetOrigin($__QPDF_SORIGIN_TopLeft); $oQP.SetMeasurementUnits($__QPDF_MUNITS_Milimeters) $oQP.CopyPageRanges($iIDMainDocument, '1') ; it is 3 page but will be second Page $oQP.SetOrigin($__QPDF_SORIGIN_TopLeft); $oQP.SetMeasurementUnits($__QPDF_MUNITS_Milimeters) $oQP.DeletePages(1, 1); Remove the "NewDocument first" empty page. $oQP.NewPage() ; Top ; it will be third Page $oQP.SetPageSize('A5 Landscape'); $oQP.SetOrigin($__QPDF_SORIGIN_TopLeft); $oQP.SetMeasurementUnits($__QPDF_MUNITS_Milimeters) $oQP.NewPage() ; Top ; it will be fourth Page $oQP.SetPageSize('A5 Landscape'); $oQP.SetOrigin($__QPDF_SORIGIN_TopLeft); $oQP.SetMeasurementUnits($__QPDF_MUNITS_Milimeters) $oQP.RemoveDocument($iIDMainDocument) $oQP.SaveToFile(@ScriptDir & "\__test_1.pdf") $oQP.SelectPage(1) ; yet, for a little while Page #1 $oQP.SetPageBox($__QPDF_BOXTYPE_CropBox, 0, 0, $__QPDF_A4_WidthInMM, $__QPDF_A4_HeightInMM / 2) ; Media Box - Set Region to Capture Local $iIDCapture1 = $oQP.CapturePageEx($oQP.SelectedPage(), $__QPDF_BOXTYPE_CropBox - 1) ; Remember Once a page has been captured it is removed from the document. $oQP.SelectPage(2) ; previously Page #3 $oQP.DrawCapturedPage($iIDCapture1, 0, 0, $__QPDF_A4_WidthInMM, $__QPDF_A4_HeightInMM / 2) ; draw CaptuedPage to SelectedPage $oQP.SaveToFile(@ScriptDir & "\__test_2.pdf"); $oQP.SelectPage(1) ; previously Page #2 $oQP.SetPageBox($__QPDF_BOXTYPE_CropBox, 0, $__QPDF_A4_HeightInMM / 2, $__QPDF_A4_WidthInMM, $__QPDF_A4_HeightInMM / 2) ; Media Box - Set Region to Capture Local $iIDCapture2 = $oQP.CapturePageEx($oQP.SelectedPage(), $__QPDF_BOXTYPE_CropBox - 1) ; Remember Once a page has been captured it is removed from the document. $oQP.SelectPage(2) ; previously Page #4 $oQP.DrawCapturedPage($iIDCapture2, 0, 0, $__QPDF_A4_WidthInMM, $__QPDF_A4_HeightInMM / 2) ; draw CaptuedPage to SelectedPage $oQP.SaveToFile(@ScriptDir & "\__test_3.pdf") $oQP.SaveToFile(@ScriptDir & "\A5Format_UpperAndBottom.pdf"); #EndRegion Create New PDF File with 2* new A5 Landscape Page Sleep(100) #Region Splitting Local $sPDF_Destination = '' $oQP.ExtractFilePages(@ScriptDir & "\A5Format_UpperAndBottom.pdf", '', @ScriptDir & '\A5Format_Upper.pdf', 1) $oQP.ExtractFilePages(@ScriptDir & "\A5Format_UpperAndBottom.pdf", '', @ScriptDir & '\A5Format_Bottom.pdf', 2) #EndRegion Splitting EndIf EndFunc ;==>_QPDF_A4toA5 REMARKS: $oQP is a Object created by this Function: _QPDF_CreateObjectAndUnlock($oQP) and Returned by Reference EDIT: here are results and entire script "QuickPDF_TEST_A4toA5.au3":
Edited by mLipok - 08 May 14 at 3:02PM |
|
![]() |
|
mLipok ![]() Senior Member ![]() ![]() Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
![]() ![]() ![]() ![]() ![]() |
But I have one problem:
when I use _QPDF_A4toA5() MsgBox(1, '\A5Format_Upper.pdf', _QPDF_ExtractTextFromFile(@ScriptDir & '\A5Format_Upper.pdf')) MsgBox(1, '\A5Format_Bottom.pdf', _QPDF_ExtractTextFromFile(@ScriptDir & '\A5Format_Bottom.pdf')) _QPDF_Shutdown() Then in MsgBox I see: in A5Format_Upper.pdf TOP BOTTOM and in A5Format_Bottom.pdf TOP BOTTOM QUESTION: why A5Format_Upper.pdf and A5Format_Bottom.pdf still contain the entire contents? My intention was to A5Format_Upper.pdf contained only the text "TOP" and A5Format_Bottom.pdf contained only the text "BOTTOM" |
|
![]() |
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