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!
![]() |
Insert a Background in Pdf |
Post Reply ![]() |
Author | |
kaliand ![]() Beginner ![]() Joined: 14 Apr 06 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() Posted: 14 Apr 06 at 4:05PM |
Hi everybody,
first of all sorry about my english, i'm from barcelona. i'm using the activeX dll with visual basic. i'd like to know if there's any way to insert a background in a pdf ? as in acrobat 7 professional, from a file (pdf file in my case). The background image is a pdf file in "vectorial", and i would not like to convert to a jpg file to do this. can anyone help me? Thanks and regards. |
|
![]() |
|
chicks ![]() Debenu Quick PDF Library Expert ![]() Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
![]() ![]() ![]() ![]() ![]() |
This is untested vbscript, not sure if it still works. Note how it merges the letterhead to the end of the document, captures it (which removes it from the document), then draws the captured page on all the other pages.
For a background, you may need to look at the layer functions to move it behind the text layer. <pre> '-- Init iSedQuickPDF and FSO objects Set QP = CreateObject("iSED.QuickPDF") '-- Set file names ltrHdFileName = "LetterHead.pdf" inFileName = "Document.pdf" outFileName = "Imposed.pdf" '-- Unlock the PDF library Call QP.UnlockKey(" -- YOUR QUICKPDF KEY GOES HERE -- ") '-- Load the letterhead Ret = QP.LoadFromFile(ltrHdFileName) idLetterHead = QP.SelectedDocument() WScript.Echo("Load Letterhead: " & Ret) w = QP.PageWidth() h = QP.PageHeight() '-- Load the input PDF Ret = QP.LoadFromFile(inFileName) idDocument = QP.SelectedDocument() WScript.Echo("Load File: " & Ret) '-- Merge the letterhead to the end of the document Ret = QP.MergeDocument(idLetterHead) WScript.Echo("Merge: " & Ret) '-- Capture the letterhead page ltrHdID = QP.CapturePage(QP.PageCount()) WScript.Echo("Capture ID: " & ltrHdID) Call QP.SetOrigin(1) '-- Then we get the number of pages in the document pageCount = QP.PageCount() WScript.Echo("PageCount: " & pageCount) '-- Stamp the letterhead on each page of the document For page = 1 To pageCount Call QP.SelectPage(page) WScript.Echo("Page: " & page & " Width: " & w & " Height: " & h) Ret = QP.DrawCapturedPage(ltrHdID, 0, 0, w, h) WScript.Echo("DrawCapturedPage: " & Ret) Next '-- Save the imposed file Call QP.SaveToFile(outFileName) Set QP = nothing </pre> |
|
![]() |
|
kaliand ![]() Beginner ![]() Joined: 14 Apr 06 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
thanks a lot for your quick answer, it was very usefull, an certenly it is very easy to insert a background with ised dll and i can sure hat the result is much bether than with the acrobat program.
another question, is it possible to create a pdf with dll from a microsoft officce word or excel? like distiller does? regards! |
|
![]() |
|
eliazTeez ![]() Beginner ![]() Joined: 11 Sep 17 Location: Hannover Status: Offline Points: 1 |
![]() ![]() ![]() ![]() ![]() |
If the Background is rotated then add Call doc.NormalizePage(0).
|
|
![]() |
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