从应用程序的打印输出创建pdf

时间:2018-11-26 07:08:34

标签: pdf resolution dpi

我想创建打印质量至少为4000dpi的pdf。 我的应用程序只有打印输出方法。我只想从具有打印输出选项的应用程序制作PDF。

我正在使用以下代码创建PDFCreator输出,但是输出质量较差(vb.net的最新分辨率为600dpi)。

代码:

Imports pdfforge.PDFCreator.UI.ComWrapper
Imports System.IO
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Dim btApp As BarTender.Application
    Dim btFormat As BarTender.Format
    Dim btObject As BarTender.DesignObject
    btApp = New BarTender.Application
    Dim btSubString As BarTender.SubString
    btApp.Visible = False
    btFormat = btApp.Formats.Open("C:\test\6PAGE.btw", False, "")
    btFormat.Printer = "PDFCreator"
    Dim oJobQueue As Type = Type.GetTypeFromProgID("PDFCreator.JobQueue")
    Dim PDFCreatorQueue As Object = Activator.CreateInstance(oJobQueue)
    Dim PrintJob As Object
    Dim fullPath As String
    fullPath = Path.Combine("c:\test\", "ozkantest.pdf")
    PDFCreatorQueue.Initialize()
    btFormat.PrintOut(False, False)
    PDFCreatorQueue.WaitForJob(10)
    PrintJob = PDFCreatorQueue.NextJob
    PrintJob.SetProfileSetting("OutputFormat", "Pdf")
    PrintJob.SetProfileSetting("Name", "Pdf")
    PrintJob.SetProfileSetting("TitleTemplate", "Pdf")
    PrintJob.SetProfileSetting("AuthorTemplate", "Pdf")
    PrintJob.SetProfileSetting("PdfSettings.CompressColorAndGray.Compression", "Zip") ' Settings for the compression method. Valid values: Automatic, JpegMaximum, JpegHigh, JpegMedium, JpegLow, JpegMinimum, JpegManual, Zip
    PrintJob.SetProfileSetting("PdfSettings.CompressColorAndGray.Dpi", "4000") '    Images will be resampled to this maximum resolution of the images, if resampling is enabled
    PrintJob.SetProfileSetting("PdfSettings.CompressColorAndGray.Enabled", True) '  If true, color and grayscale images will be processed according to the algorithm. If false, they will remain uncompressed
    PrintJob.SetProfileSetting("PdfSettings.CompressColorAndGray.Resampling", True) '   If true, the images will be resampled to a maximum resolution
    PrintJob.ConvertTo(fullPath)

    PDFCreatorQueue.ReleaseCom()
    PDFCreatorQueue.Clear()
    PrintJob = Nothing
    PDFCreatorQueue = Nothing
    oJobQueue = Nothing

    btFormat.Close(BarTender.BtSaveOptions.btDoNotSaveChanges)
    btApp.Quit()
    btApp = Nothing
End Sub

结束班级

我在打印机设置中选择了最高(4000dpi),但它完全没有改变。

是否有解决方案,还是必须使用其他方法创建pdf?

我没有替代方案。我在等你的帮助。 谢谢。

0 个答案:

没有答案