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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Combine 4 pages to 1 page - error
  FAQ FAQ  Forum Search   Register Register  Login Login

Combine 4 pages to 1 page - error

 Post Reply Post Reply
Author
Message
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Topic: Combine 4 pages to 1 page - error
    Posted: 28 Oct 17 at 2:04AM
I'm working on function which should Combine 4 pages to 1 page.

I was working on few pdf documents and but I get error when I use:
"Foxit Quick PDF Library 14 Upgrade Warnings.pdf" as my test file to processing.

Here is my result file:
http://lipok.pl/Debenu/Foxit Quick PDF Library 14 Upgrade Warnings.pdf__Splitted_2.pdf

Try to open this in Acrobat Reader .
Did you get Error ?
What this mean ? What I'm doing wrong ?



Edited by mLipok - 28 Oct 17 at 2:06AM
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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (1) Thanks(1)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 28 Oct 17 at 10:06AM
Directly open in Firefox browser with pdf-plugin - no problem
Open with SumatraPDF - no problem
Open with Foxit - no problem
Open with Acrobat Reader DC:
"The page structure data contains an invalid node".
From my opinion there's an unused node or the same node twice inside the structure.
It should have to do with not starting from scratch and that you're copying too much together.
There will be same things on the four pages...


Cheers,
Ingo

Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 28 Oct 17 at 1:53PM
Thanks for your answer.

Soon I share my code.
I hope, you will be able to send to me any tips, saying what I can code better.



Edited by mLipok - 28 Oct 17 at 1:53PM
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
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 28 Oct 17 at 3:01PM
Is it possible that the source pdf have Bookmarks/Links ?

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
Back to Top
Nick View Drop Down
Team Player
Team Player


Joined: 19 Dec 14
Location: USA
Status: Offline
Points: 28
Post Options Post Options   Thanks (1) Thanks(1)   Quote Nick Quote  Post ReplyReply Direct Link To This Post Posted: 26 Feb 18 at 8:57AM

Hi mLipok!

If you mean the message "The page structure data contains an invalid node", then I use the QP.SetOpenActionDestination (1, -1) function to remove this message before saving the file.
Try it.

Nick.

Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 26 Feb 18 at 9:17AM
Do you do this trick for every saving ?
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
Back to Top
Nick View Drop Down
Team Player
Team Player


Joined: 19 Dec 14
Location: USA
Status: Offline
Points: 28
Post Options Post Options   Thanks (1) Thanks(1)   Quote Nick Quote  Post ReplyReply Direct Link To This Post Posted: 26 Feb 18 at 1:20PM
Of necessity. You can use QP.RemoveOpenAction function. Same result.
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 28 Feb 18 at 2:34PM
Finally tested.
It works like a charm.

Thanks again
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
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 28 Feb 18 at 2:39PM
; #FUNCTION# ====================================================================================================================
; Name ..........: _QPDF_Page_2in1
; Description ...: TODO
; Syntax ........: _QPDF_Page_2in1(Byref $oQP[, $bAddSplitter = False[, $bReverseUpDown = False[, $bTurnRight = True]]])
; Parameters ....: $oQP                 - [in/out] Reference to a QuickPDF object.
;                  $bAddSplitter        - [optional] A boolean value. Default is False.
;                  $bReverseUpDown      - [optional] A boolean value. Default is False.
;                  $bTurnRight          - [optional] a boolean value. Default is True.
; Return values .: TODO
; Author ........: mLipok
; Modified ......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func _QPDF_Page_2in1(ByRef $oQP, $bAddSplitter = False, $bReverseUpDown = False, $bTurnRight = True)
__QPDF_IsUnlocked($oQP)
If @error Then Return SetError(@error, @extended, $QPDF_RET_FAILURE)

;~ _QPDF_Display() - only for testing - This is my own function
;~ _QPDF_Display($oQP, 'Loaded document 1 - Page 1', -1, 0, 600, 1)
;~ _QPDF_Display($oQP, 'Loaded document 1 - Page 2', -1, 0, 600, 2)

Local $iOrginalPageCount = $oQP.PageCount()

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

Local $iID_CapturedPage

If Not $iOrginalPageCount > 1 Then Return SetError($QPDF_ERR_GENERAL, $QPDF_EXT_DEFAULT, 0)

For $iCurrentPage = 1 To $iOrginalPageCount
; MsgBox() - only for testing
; MsgBox(0, '$iCurrentPage', $iCurrentPage & ' / ' & $iOrginalPageCount)
If Not $bNewPageHaveDrawedTopOfPage Then
$oQP.NewPage()
$oQP.NormalizePage(0)
$iNewPageCounter += 1
$oQP.MovePage($iNewPageCounter)
$oQP.SetPageSize('A4')
$oQP.SetMeasurementUnits($__eQPDF_MUNITS_Milimeters)
If $bAddSplitter Then
$oQP.SetLineWidth(1)
$oQP.SetLineColor(1, 0, 0)
; @TODO _QPDF_SetDefaultCoordinates($oQP)
$oQP.DrawLine(0, $__eQPDF_A4_HeightInMM / 2, $__eQPDF_A4_WidthInMM, $__eQPDF_A4_HeightInMM / 2)
; MsgBox() - only for testing
; MsgBox(0, '$oQP.GetOrigin', $oQP.GetOrigin())

EndIf
EndIf

;~ _QPDF_Display() - only for testing - This is my own function
;~ _QPDF_Display($oQP, 'Page: $iCurrentPage + $iNewPageCounter: ' & $iCurrentPage & '/' & $iNewPageCounter & '/' & $iNewPageCounter + 1, $iNewPageCounter + 1)

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

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

#CS
Foxit Quick PDF Library 13.12 Reference Guide.pdf

Function DebenuPDFLibrary1312.PDFLibrary::DrawRotatedCapturedPage(
CaptureID As Long, Left As Double, Bottom As Double,
Width As Double, Height As Double, Angle As Double) As Long

Note that the anchor point is the bottom-left corner
#CE
ConsoleWrite("! " & $bNewPageHaveDrawedTopOfPage & "  " & $bReverseUpDown & @CRLF)
If $bTurnRight Then
If _
($bNewPageHaveDrawedTopOfPage = False And $bReverseUpDown = False) _
Or _
($bNewPageHaveDrawedTopOfPage = True And $bReverseUpDown = True) _
Then
; draw on top of page
$oQP.DrawRotatedCapturedPage( _
$iID_CapturedPage, 0, $__eQPDF_A4_HeightInMM, _
$__eQPDF_A4_HeightInMM / 2, $__eQPDF_A4_WidthInMM, 270 _
)
$bNewPageHaveDrawedTopOfPage = (Not $bReverseUpDown)
Else
; draw on bootom of page
$oQP.DrawRotatedCapturedPage( _
$iID_CapturedPage, 0, $__eQPDF_A4_HeightInMM / 2, _
$__eQPDF_A4_HeightInMM / 2, $__eQPDF_A4_WidthInMM, 270 _
)
$bNewPageHaveDrawedTopOfPage = ($bReverseUpDown)
EndIf
Else
If _
($bNewPageHaveDrawedTopOfPage = False And $bReverseUpDown = False) _
Or _
($bNewPageHaveDrawedTopOfPage = True And $bReverseUpDown = True) _
Then
; draw on top of page
$oQP.DrawRotatedCapturedPage( _
$iID_CapturedPage, $__eQPDF_A4_WidthInMM, $__eQPDF_A4_HeightInMM / 2, _
$__eQPDF_A4_HeightInMM / 2, $__eQPDF_A4_WidthInMM, 90 _
)
$bNewPageHaveDrawedTopOfPage = (Not $bReverseUpDown)
Else
; draw on bootom of page
$oQP.DrawRotatedCapturedPage( _
$iID_CapturedPage, $__eQPDF_A4_WidthInMM, 0, _
$__eQPDF_A4_HeightInMM / 2, $__eQPDF_A4_WidthInMM, 90 _
)
$bNewPageHaveDrawedTopOfPage = ($bReverseUpDown)
EndIf
EndIf
Next
;~ _QPDF_Display($oQP, 'After Change', -1, 0, 600, 1)
EndFunc   ;==>_QPDF_Page_2in1

How to use:

_QPDF_Page_2in1($oQP, True, False, True)
_QPDF_Page_2in1($oQP, True, False, False)
_QPDF_SaveToFile($oQP, $sPDF_FileFullPath & '__Splitted.pdf')

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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store