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!
![]() |
place one pdf on another |
Post Reply ![]() |
Author | |
Karsten ![]() Beginner ![]() Joined: 27 Apr 09 Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() Posted: 27 Apr 09 at 2:24PM |
Hi,
I'm looking for a solution to do the following steps.
1.
I must create an emty single side pdf with special dimensions in millimeters
PDFLibrary := TQuickPDF0712.Create;
PDFLibrary.SetPageDimensions (310*72/25.4,510*72/25.4);
2.
I must place on this page a second pdf-file on position X1,Y1
3.
I must place on this page an eps-file on position X2,Y2
4.
Save this PDF-document
PDFLibrary.SaveToFile('D:\placed.pdf');
Are the steps 2 and 3 possible with the Quick PDF Library or not?
I use imagemagick on this time to do that but the quality is not so good.
Karsten Edited by Karsten - 27 Apr 09 at 2:32PM |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Karsten!
You can't put one pdf over the other! You can merge pdf-documents one after the other ... What you can do is creating a first pdf and then painting images (like your second and third pdf) on special places of the first pdf. You can determine if it shall be transparency or not and a lot more... Cheers, Ingo |
|
![]() |
|
DELBEKE ![]() Debenu Quick PDF Library Expert ![]() ![]() Joined: 31 Oct 05 Location: France Status: Offline Points: 151 |
![]() ![]() ![]() ![]() ![]() |
Hi Karsten Ingo say You can merge pdf-documents one after the other, that's right, but you can use CapturePage and DrawCapturedPage for the point 2.
|
|
![]() |
|
Karsten ![]() Beginner ![]() Joined: 27 Apr 09 Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
Thx,
Do you have an example to do this?
I do this
PDFLibrary.SetPageDimensions (310*72/25.4,510*72/25.4);
PDFLibrary.SaveToFile('D:\quickpdf\test\empty.pdf'); PDFLibrary.ClearFileList('mylist'); PDFLibrary.AddToFileList('mylist','D:\quickpdf\test\empty.pdf'); PDFLibrary.AddToFileList('mylist','D:\quickpdf\test\test1.pdf'); PDFLibrary.AddToFileList('mylist','D:\quickpdf\test\test2.pdf'); PDFLibrary.MergeFileList('mylist','D:\quickpdf\test\merge.pdf'); and now I must draw the content of page2 and page 3 to the empty page 1 on position X1,Y1 and X2,Y2
after this I can delete page 2 and page 3 and save again.
Karsten Edited by Karsten - 28 Apr 09 at 2:18AM |
|
![]() |
|
DELBEKE ![]() Debenu Quick PDF Library Expert ![]() ![]() Joined: 31 Oct 05 Location: France Status: Offline Points: 151 |
![]() ![]() ![]() ![]() ![]() |
here is a vb6 sample for drawing a pdf onto an other
Private Sub Command1_Click()
Dim IdMain As Long Dim IdIncluded As Long Dim IdCaptured As Long Dim LastPage As Long Dim lRet As Long
m_Doc.UnlockKey "mykey" lRet = m_Doc.LoadFromFile(Text1.Text) 'load main file IdMain = m_Doc.GetDocumentID(m_Doc.DocumentCount) 'save it's id LastPage = m_Doc.PageCount 'save nb page in the main doc lRet = m_Doc.LoadFromFile(Text2.Text) 'load pdf to be included IdIncluded = m_Doc.GetDocumentID(m_Doc.DocumentCount) 'save it's id lRet = m_Doc.SelectDocument(IdMain) 'select back main doc m_Doc.MergeDocument IdIncluded 'merge the 2 pdfs IdCaptured = m_Doc.CapturePage(LastPage + 1) 'capture the fist page of the second pdf m_Doc.SelectPage 1 's'lect the page that wil receive the capture m_Doc.SetOrigin 1 'coord origin top left m_Doc.SetMeasurementUnits 1 'use millimeters as unit for coords lRet = m_Doc.DrawCapturedPage(IdCaptured, 10, 10, 150, 150) 'draw the captured page 'clear possible extra pages got from the second pdf If m_Doc.PageCount > LastPage Then m_Doc.DeletePages LastPage + 1, m_Doc.PageCount End If 'finaly save the result lRet = m_Doc.SaveToFile("c:\test.pdf") 'clear doc
m_Doc.RemoveDocument IdMain End Sub |
|
![]() |
|
Karsten ![]() Beginner ![]() Joined: 27 Apr 09 Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
thx. it works great for step 2 of the first post. Now I need only the solution for step 3 to place an eps-file onto the pdf.
Any idea?
Karsten
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Karsten!
The description/functions about drawing an image on a pdf you can find in the online-documentation at the section "image handling"... "DrawImage" should be your choice.
After loading your pdf-document ...
First:
AddImageFromFile
Then:
SelectImage
At least:
DrawImage
Supported imagetypes are
BMP, TIFF, JPEG, PNG, GIF, WMF and EMF.
So you should convert your eps-file first.
Cheers, Ingo
Edited by Ingo - 28 Apr 09 at 8:44AM |
|
![]() |
|
Karsten ![]() Beginner ![]() Joined: 27 Apr 09 Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
all works fine, now I test it with Delphi 2009 and the Beta libraries. Thx
|
|
![]() |
|
Karsten ![]() Beginner ![]() Joined: 27 Apr 09 Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
Thx at all,
It works realy good for my problem in delphi 2009 with the beta-files. When will release the Delphi2009 DCU's.
I will purchase one license today
![]() Karsten
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Karsten!
Such a question you should post at "contact" on www.quickpdflibrary.com . Cheers, Ingo |
|
![]() |
|
deabrew ![]() Newbie ![]() ![]() Joined: 19 Jan 09 Status: Offline Points: 43 |
![]() ![]() ![]() ![]() ![]() |
We're on the case! At the moment the end date is TBA, but it shouldn't be too much longer. I don't want to provide an exact date just yet...
|
|
![]() |
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