Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 504577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:30:37+00:00 2026-05-13T06:30:37+00:00

in vb.net please if possible

  • 0

in vb.net please if possible

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:30:37+00:00Added an answer on May 13, 2026 at 6:30 am

    You can create a Rectangle object and set its BackgroundColor property. Use your Rectangle to initialize your Document.

    This tutorial on the iTextSharp site on SourceForge describes this (see the PageSize section).

    The same site has a code sample that demonstrates what you need to do. (see ‘step 1’). The sample is in C# and I know you want it in VB.NET so I ran it through the C# to VB.NET converter on the developerfusion site. I can’t test compile the results from the machine I’m not now, but the code looks reasonable:

    Imports System
    Imports System.IO
    
    Imports iTextSharp.text
    Imports iTextSharp.text.pdf
    
    Public Class Chap0102
    
        Public Shared Sub Main()
            Console.WriteLine("Chapter 1 example 2: PageSize")
    
            ' step 1: creation of a document-object
            Dim pageSize As New Rectangle(144, 720)
            pageSize.BackgroundColor = New Color(&Hff, &Hff, &Hde)
            Dim document As New Document(pageSize)
    
            Try
    
                ' step 2:
                ' we create a writer that listens to the document
                ' and directs a PDF-stream to a file
    
                PdfWriter.getInstance(document, New FileStream("Chap0102.pdf", FileMode.Create))
    
                ' step 3: we open the document
                document.Open()
    
                ' step 4: we Add some paragraphs to the document
                For i As Integer = 0 To 4
                    document.Add(New Paragraph("Hello World"))
    
                Next
            Catch de As DocumentException
                Console.[Error].WriteLine(de.Message)
            Catch ioe As IOException
                Console.[Error].WriteLine(ioe.Message)
            End Try
    
            ' step 5: we close the document
            document.Close()
        End Sub
    End Class
    

    Give it a try.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: What is a CAPTCHA that is compatible with ASP.NET MVC ? Please
i am new to asp.net mvc so please be explicit as possible. Here is
Is it possible to use javascript in Mobile .NET, if yes please let me
Could someone explain ASP.NET Convention Based Naming and provide some examples if possible please
please discuss if Client side data binding is possible in asp.net 4.0 and also
Possible Duplicate: Running .net based application without .NET Framework Hello. Please let me know
How do you implement the search capabilities of Lucene.net in asp.net? If possible, please
Possible Duplicate: .prop() vs .attr() Please take a look at this fiddle: http://jsfiddle.net/DGzvP/ $(#test).prop({
is it possible to implement short urls in asp.net 2.0 version. please give me
I'm very new to ASP.net MVC, so please be as descriptive as possible in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.