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!
![]() |
Adding Images and Text Styles |
Post Reply
|
| Author | |
MoneyRan
Beginner
Joined: 11 Aug 11 Status: Offline Points: 15 |
Post Options
Thanks(0)
Quote Reply
Topic: Adding Images and Text StylesPosted: 22 Sep 11 at 2:49PM |
|
I am trying to add a picture to an exixting PDF file :
'Load PDF File QP.LoadFromFile( "C:\Users\mranade\Desktop\AppConfirm.pdf") 'Load Image from File Dim logoID As Integer = QP.AddImageFromFile("C:\Users\mranade\Desktop\Manasi\logo.jpg", 0)(this logoID is always 0)
'Select Added Image
Dim si As Integer = QP.SelectImage(logoID)
'Get Height and Width of Selected Image
Dim logoHeight As Integer = QP.ImageHeight()
Dim logoWidth As Integer = QP.ImageWidth()
'DrawImage on the PDF File
QP.DrawImage(450, 50, logoWidth, logoHeight) 'Save PDF FileQP.SaveToFile( "C:\Users\mranade\Desktop\AppConfirm.pdf")But this doesn't work. Am I missing something? I got the code from the QuickPDF Demo Library that I downloaded from the website. Also, I am trying to change text style by using QP.SetTextSize() and QP.AddStandard Font() functions, but these too don;t make any change in the file. Everything looks the same. Should I be doing something before using these functions?
|
|
![]() |
|
AndrewC
Moderator Group
Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 Sep 11 at 4:52PM |
|
logoID should not be 0 and that is most likely the problem. Can you create a support ticket and then send the LOGO.JPG file. You can create a ticket from the following form - http://www.quickpdflibrary.com/support/support-query.php - Once you get an initial reply with your ticket number you can reply and just attach the JPG in your email.
Andrew.
|
|
![]() |
|
MoneyRan
Beginner
Joined: 11 Aug 11 Status: Offline Points: 15 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 Sep 11 at 6:59PM |
|
I looked up the Function Reference and it said QuickPDF only supports .JPEG and not .JPG. I changed it and the problem was solved. But I will send the picture just in case.
Edited by MoneyRan - 22 Sep 11 at 7:50PM |
|
![]() |
|
MoneyRan
Beginner
Joined: 11 Aug 11 Status: Offline Points: 15 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 Sep 11 at 7:28PM |
|
Another question: I want to apply three styles to a page. But everything looks th same except for the TextColor. This is my complete code:
Dim dlastline As Integer = 550 Private Sub ButtonCreate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonCreate.Click
Dim newdoc As Integer = QP.NewDocument()
FillHeaderData()
FillFooterAndSaveFile() DrawFigures()
End If
End Sub Public Sub FillHeaderData()
'612 X 792 <-- PDF Document Dimensions
QP.SetOrigin(1)
QP.SetTextAlign(1) QP.SetTextSize(32)
QP.AddStandardFont(5) QP.SetTextColor(120, 0, 0) QP.SaveStyle("HeaderStyle") QP.DrawText(306, 100, "Company Name") QP.RemoveStyle("HeaderStyle")
QP.SetTextSize(14)
QP.AddStandardFont(8) QP.SetTextUnderline(1) QP.SetTextColor(0, 0, 0) QP.SaveStyle("LetterHead") QP.DrawText(306, 125, "Meeting Agenda") QP.RemoveStyle("LetterHead")
QP.SetTextAlign(0)
QP.SetTextSize(8)
QP.AddStandardFont(8) QP.SetTextColor(0, 0, 0) QP.SetTextUnderline(0) QP.SaveStyle("LetterBody") QP.DrawText(306, 250, "This is what we will do: ") End Sub
Public Sub FillFooterAndSaveFile()
QP.DrawText(75, dlastline + 15, "End of Meeting Agenda.") QP.DrawText(75, dlastline + 90, "Sign Here. ")
QP.DrawText(75, dlastline + 150, "John Smith")
Dim save As Integer = QP.SaveToFile("C:\Users\mranade\Desktop\AppConfirm.pdf") End Sub
DrawFigures() has the code I posted earlier in this thread. Edited by MoneyRan - 22 Sep 11 at 7:31PM |
|
![]() |
|
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