create pdf from printout of application


#1

Hi,

I want to create pdf with at least 4000dpi print quality. My application has only printout method. I just want to make PDF from an application with printout option.

I'm creating a PDFCreator output with the following code, but it gives poor quality output (last 600dpi with vb.net).

Code:

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

End Class

I chose the highest(4000dpi) in the printer settings, but it doesn't change at all.

Is there a solution to it or do i have to create a pdf with an alternative method?

I don't have a solution for the alternative. I'm waiting for your help. Thank you.


#2

Hi,

does the original image have 4000 or more DPI?
PDFCreator can only downsample , the DPI will never be higher than that of the original document.
Your settings look correct.

Best regards

Robin


#3

Hi

The setting is 4000 but not more than 600. 4000 works when I get it manually.
4000 does not work with this function.