Hello,
i want to insert an image into a PDF. The image should be positioned at right upper corner.
I found this https://gist.github.com/Polaringu/daa06 ... c36cbeb14d, but how can i add an image on page still exists.
An example in C# or VB would be great. Thanks.
Best Regards,
edvschu
Add Image On Page SOLVED
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Add Image On Page
Hello edvschu,
What other sample do you need, when you already have a needed sample?
Cheers,
Alex
What other sample do you need, when you already have a needed sample?
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Add Image On Page SOLVED
Your documentation is sometimes hard to read, but I've got it. Here is my code. Perhaps it would help others:
Regards,
edvschu
Code: Select all
Private Sub AddImageOnPage()
Dim pDoc As PDFXCoreAPI.IPXC_Document = OpenDocumentFromFile(sFileAddImage, pdfInst)
If pDoc Is Nothing Then
Return
End If
Dim sFileWithAddedImage As String = sFileAddImage & ".add.pdf"
Dim img As PDFXCoreAPI.IPXC_Image = pDoc.AddImageFromFile(sImage)
Dim m As PDFXCoreAPI.PXC_Matrix
m.a = 747 / 5 'Image Width
m.d = 601 / 5 'Image Height
m.e = 460 'Location x
m.f = 700 'Location y
Dim cc As PDFXCoreAPI.IPXC_ContentCreator = pDoc.CreateContentCreator()
cc.ConcatCS(m)
cc.PlaceImage(img)
Dim iPage As Integer = 1
pDoc.Pages.Item(Convert.ToUInt32(iPage - 1)).PlaceContent(cc.Detach(), CUInt(PDFXCoreAPI.PXC_PlaceContentFlags.PlaceContent_Before))
pDoc.WriteToFile(sFileWithAddedImage)
pDoc.Close()
pDoc = Nothing
End Sub
edvschu
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Add Image On Page
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ