VB.NET PDF景观. [英] VB.NET PDF Landscape.

查看:76
本文介绍了VB.NET PDF景观.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用VB.NET创建PDF文件的代码,
现在我的问题是我无法将其设置为横向格式.
有人可以在这里发布一些代码,任何建议表示赞赏

谢谢......

这是我的代码:

I have a code for creating a PDF file using VB.NET,
now my problem is I cant make it as a Landscape format.
Can someone post some codes here, any suggestion is appreciated

Thanks....

here''s my code:

Imports iTextSharp.text
Imports iTextSharp.text.Phrase
Imports iTextSharp.text.pdf
Imports iTextSharp.text.Image
Imports System.IO

Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim document As New Document()
        Dim sFilePDF As String = "C:\Chap0514.pdf"
        Dim writer = PdfWriter.GetInstance(document, New FileStream(sFilePDF, FileMode.Create))
        document.Open()
        Dim img As Image = Image.GetInstance("C:\Images\Sample.TIF")
        Dim txt As New Phrase("Sample PDF")
        document.Add(txt)
        document.Add(img)
        document.Add(img)
        document.Add(img)
        document.Add(img)
        document.Add(img)
        document.Add(img)
        document.Close()
    End Sub
End Class

推荐答案

[
I googled[^] and found this[^] post, which seems to suggest that you just have to rotate it...the sample code was a bit different than what you have and it''s in C#, but this is what they used:

Document doc = new Document(iTextSharp.text.PageSize.LETTER.Rotate(), 10, 10, 42, 35);


这篇关于VB.NET PDF景观.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆