ComponentOne PDF创建 [英] ComponentOne PDF creation

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

问题描述

我在创建PDF时使用componentone遇到了问题.当我从RTF文件创建PDF时,页面右侧的许多段落将无法查看,因为创建的pdf没有垂直滚动,就好像没有理由滚动一样. PDF也将始终只有1页.它总是只打印第一页.我的代码在下面,如果有人可以帮助...

I am having an issue using componentone in creating PDF''s. When I create the PDF from a RTF file, alot of the paragraph on the right of the page will not be viewable as the created pdf has no vertical scroll as if theres no reason to scroll. Also the pdf will always be only 1 page. It always prints the first page only. My code is below if anyone can help...

<pre lang="vb">Dim pdf As New C1.C1Pdf.C1PdfDocument
      Dim fs As System.IO.FileStream
      Dim sreader As System.IO.StreamReader
      Dim s As String
      fs = New System.IO.FileStream(currentFile, FileMode.Open, FileAccess.ReadWrite, FileShare.Read)
      sreader = New StreamReader(fs)

      s = sreader.ReadToEnd()
      Dim txtFont As Font = RTB.Font
      Dim txtH, txtW As Integer
      Dim LMargin, TMargin As Integer
      '' Calculate the dimensions of the printable area of the page
      With PrintDocument1.DefaultPageSettings
          txtH = .PaperSize.Height - _
                 .Margins.Top - .Margins.Bottom
          txtW = .PaperSize.Width - _
                 .Margins.Left - .Margins.Right
          LMargin = PrintDocument1.DefaultPageSettings.Margins.Left
          TMargin = PrintDocument1.DefaultPageSettings.Margins.Top
      End With
      ''Dim rr As New RectangleF(1, 1, 1, 1)
      Dim R As New RectangleF(LMargin, TMargin, txtW, txtH)
      Dim rc As RectangleF = pdf.PageRectangle
      '' pdf.DrawRectangle(Pens.Blue, New Rectangle(LMargin, TMargin, txtW, txtH))
      '' rc.Inflate((-1 * txtH), (-1 * txtW))
      pdf.DrawStringRtf(s, SystemFonts.DefaultFont, Brushes.Black, R)

      SaveFileDialog1.Title = "Save PDF File"
      SaveFileDialog1.DefaultExt = "pdf"
      If OS = "XP" Then
          SaveFileDialog1.Filter = "PDF Files (*.pdf)|*.pdf"
      Else
          SaveFileDialog1.Filter = "PDF Files|*.pdf"
      End If

      SaveFileDialog1.FilterIndex = 1
      SaveFileDialog1.FileName = ""
      SaveFileDialog1.ShowDialog()
      If SaveFileDialog1.FileName = "" Then Exit Sub
      If SaveFileDialog1.FileName = currentFile Then Exit Sub
      If SaveFileDialog1.FileName = "SaveFileDialog1" Then Exit Sub
      pdf.Save(SaveFileDialog1.FileName)





推荐答案

您是否尝试过在此处查看:
已知识库的 [ ^ ]
ComponentOne支持论坛 [ ^ ]
ComponentOne社区论坛 [ ^ ]

张贴在这里很好.也许有人可以帮忙,但我发现与第三者有关的特定问题可以在各自的论坛中得到更快,更准确的回答.
Did you tried looking here:
Knowledgebase documneted[^]
ComponentOne Support Forum[^]
ComponentOne Cummunity Forum[^]

Posting here is fine. Might be someone can help but I had found that specific questions related to 3rd party is answered more quickly and accurately at respective forums.


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

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