Merge PDFs with background images
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=3551
Printed Date: 29 Apr 25 at 10:31AM Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com
Topic: Merge PDFs with background images
Posted By: Franco
Subject: Merge PDFs with background images
Date Posted: 15 Mar 18 at 3:13PM
Hi,
done a job with merging many PDF docs together to a single new PDF. All works fine. The PDFs are containing formatted text and a few vector objects like rectangles or cyrcles.
Now I have to insert background images in the new main document, each merged PDF with an own jpg image as background. The text and vectors of the different merged files should naturally be in front of the background images within the new main document.
After drawing the image in the new document and then merging, the white background of the merged PDF overlapped the image, so there is a white rectangle (media box) over the image.
Is there a way to remove the white background of the PDFs before merging, so that only the text and vector objects are moved to the new document ? Other recommendations ?
Thanks for any advice.
Frank
|
Replies:
Posted By: Franco
Date Posted: 15 Mar 18 at 4:49PM
Have seen something in the docs and will give the contentstreams a try. After all pages are merged in the new page of the main, NewContentstream and place the background images there, then Movecontentstream to 1.
|
Posted By: Franco
Date Posted: 16 Mar 18 at 10:12AM
Doesn't work, there are still white rectangles of the merged pdf over the background images.
Using Quick library11.15 with Clarion. Here the Code:
QPL.ClearFileList('List1') Loop Zae = 1 to ... .... QPL.AddToFileList('List1', pathname-array) End
DateiSumme = QPL.MergeFileList('List1', PDFDateinameNeu) ... If Not QPL.LoadFromFile(PDFDateinameNeu,'') Exit End
!New page in new main document Akt_Seite += 1 QPL.InsertPages(Akt_Seite, 1) QPL.SelectPage(Akt_Seite) QPL.SetMeasurementUnits(1) QPL.SetOrigin(1) QPL.SetPageDimensions(BOG:Bogengroesse_X, BOG:Bogengoesse_Y)
!capture single pdf for merging PDF_Seite += 1 QPL.SelectPage(PDF_Seite) QPL.SetMeasurementUnits(1) PDF_Hoehe = QPL.GetPageBox(1,3) PDF_Breite = QPL.GetPageBox(1,2) PDF_ID = QPL.CapturePage(PDF_Seite) ....
!merging file x-times on one page of the new doc. QPL.SelectPage(Akt_Seite) QPL.DrawCapturedPage(PDF_ID, BOG:StartPosX, BOG:StartPosY, PDF_Breite, PDF_Hoehe) ....
!draw background images HintergrundStream = QPL.NewContentStream() QPL.SelectContentStream(HintergrundStream) QPL.DrawImage(BauPosX, BauPosY, BAU:Bild_Breite, BAU:Bild_Hoehe)
... !Move Image Stream to 1 If HintergrundStream > 0 QPL.MoveContentStream(HintergrundStream, 1) HintergrundStream = 0 QPL.CombineContentStreams() End
!PDF-Information QPL.SetInformation(0, '1.4') QPL.SetInformation(5, 'Demo Tools Franco') QPL.SetInformation(6, 'Demo-Manager xyz')
!Save PDF QPL.SaveToFile(Clip(PDFDateinameNeu))
|
Posted By: Franco
Date Posted: 16 Mar 18 at 4:05PM
... there was indeed an unrecognizable white filled curve behind the Text surfacing the whole page! Unbelievable. Thx ;-)
|
|