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 - Adding Images and Text Styles
  FAQ FAQ  Forum Search   Register Register  Login Login

Adding Images and Text Styles

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


Joined: 11 Aug 11
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote MoneyRan Quote  Post ReplyReply Direct Link To This Post Topic: Adding Images and Text Styles
    Posted: 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 File

QP.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?
 
 
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
MoneyRan View Drop Down
Beginner
Beginner


Joined: 11 Aug 11
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote MoneyRan Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
MoneyRan View Drop Down
Beginner
Beginner


Joined: 11 Aug 11
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote MoneyRan Quote  Post ReplyReply Direct Link To This Post 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
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