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 - Insert a Background in Pdf
  FAQ FAQ  Forum Search   Register Register  Login Login

Insert a Background in Pdf

 Post Reply Post Reply
Author
Message
kaliand View Drop Down
Beginner
Beginner


Joined: 14 Apr 06
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote kaliand Quote  Post ReplyReply Direct Link To This Post Topic: Insert a Background in Pdf
    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.
Back to Top
chicks View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 29 Oct 05
Location: United States
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote chicks Quote  Post ReplyReply Direct Link To This Post Posted: 14 Apr 06 at 5:58PM
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>
Back to Top
kaliand View Drop Down
Beginner
Beginner


Joined: 14 Apr 06
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote kaliand Quote  Post ReplyReply Direct Link To This Post Posted: 16 Apr 06 at 12:25PM
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!
Back to Top
eliazTeez View Drop Down
Beginner
Beginner


Joined: 11 Sep 17
Location: Hannover
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote eliazTeez Quote  Post ReplyReply Direct Link To This Post Posted: 11 Sep 17 at 2:01PM
If the Background is rotated then add Call doc.NormalizePage(0).

'-- 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)
    Call doc.NormalizePage(0)
    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 
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