Print Page | Close Window

Printing two pages in one

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2928
Printed Date: 04 May 24 at 5:32AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Printing two pages in one
Posted By: ggirarde
Subject: Printing two pages in one
Date Posted: 30 Jun 14 at 6:08PM
Since many printers directly support the 2 pages in 1 and 4 pages in 1 printing, I tought it were a simple thing to get this done with QuickPdf Library on the right printer but, after some search about SetupCustomPrinter, PrintOptions and GetPrinterBins, I feel lost.

Is there any way to do it?


Ty in advance.



Replies:
Posted By: Paul
Date Posted: 01 Jul 14 at 9:18AM
Debenu Quick PDF Library does not have this option yet. This could be a good feature. Try to send it via this form: http://www.debenu.com/support/contact/


Posted By: mLipok
Date Posted: 01 Jul 14 at 11:25AM
did you look at this:
http://www.debenu.com/docs/pdf_library_reference/DrawCapturedPage.php

cheers
mLipok


-------------
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


Posted By: mLipok
Date Posted: 01 Jul 14 at 11:27AM
I think I can create an example in this weekend.



-------------
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


Posted By: AndrewC
Date Posted: 02 Jul 14 at 6:57AM

It will not be possible to do this with SetupCustomPrinter and Devmode as the settings for nUp printer would need to be contained in a custom part of the DEVMODE structure which would be different for every printer driver and also undocumented. This is the same reason many custom features such as fancy bins and other options cannot be supported reliably.  Many drivers respect the values in the DEVMODE structure and many drivers ignore most of it and define there own additional and undocumented DEVMODE structure.

The only way to do this is via CapturePage and DrawCapturedPage.

Andrew.

Andrew.


Posted By: ggirarde
Date Posted: 08 Jul 14 at 11:18AM
CapturePage and DrawCapturedPage ... very interesting suggestion.

Ty a lot for your response :)


Posted By: mLipok
Date Posted: 23 Oct 14 at 2:13PM
Finally I have time to finish it.


Func _QP_Page_2in1(ByRef $oQP, $bAddSplitter = False)
Local $iOrginalPageCount = $oQP.PageCount()

Local $iNewPageCounter = 0
Local $bNewPageHaveDrawedTopOfPage = False ; 1 = true ,  0 = false

Local $iID_CapturedPage

If $iOrginalPageCount > 1 Then
For $iCurrentPage = 1 To $iOrginalPageCount
If Not $bNewPageHaveDrawedTopOfPage Then
$oQP.NewPage()
$iNewPageCounter += 1
$oQP.MovePage($iNewPageCounter)
$oQP.SetPageSize('A4')
If $bAddSplitter Then
$oQP.SetLineWidth(1)
$oQP.SetLineColor(1, 0, 0)
$oQP.SetMeasurementUnits($__eQPDF_MUNITS_Milimeters)
$oQP.DrawLine(0, $__eQPDF_A4_HeightInMM / 2, $__eQPDF_A4_WidthInMM, $__eQPDF_A4_HeightInMM / 2)
EndIf
EndIf

$iID_CapturedPage = $oQP.CapturePage($iNewPageCounter + 1)

; select Page to which you want Insert content - Draw Captutred Page
$oQP.SelectPage($iNewPageCounter)

If Not $bNewPageHaveDrawedTopOfPage Then
; draw on top of page
$oQP.DrawRotatedCapturedPage($iID_CapturedPage, 0, _
$__eQPDF_A4_HeightInMM, _
$__eQPDF_A4_HeightInMM / 2, $__eQPDF_A4_WidthInMM, 270)
$bNewPageHaveDrawedTopOfPage = True
Else
; draw on bottom of page
$oQP.DrawRotatedCapturedPage($iID_CapturedPage, 0, _
$__eQPDF_A4_HeightInMM / 2, _
$__eQPDF_A4_HeightInMM / 2, $__eQPDF_A4_WidthInMM, 270)
$bNewPageHaveDrawedTopOfPage = False
EndIf
Next
EndIf
EndFunc   ;==>_QP_Page_2in1

Edit: Typo


-------------
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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk