我试图使用SumatraPDF从VB.Net页面打印景观布局,但页面被剪切。如果我打开SumatraPDF可执行文件并从app打印同一页,它会工作得很好。下面是我使用的命令:
Private Sub PrintReport()
Try
Dim sPath As String = Request.PhysicalApplicationPath.ToString() + "ReportOutput\"
Dim command As String = """" + sPath + "SumatraPDF.exe"" -print-to """ + Me.Printer + """ """ + sPath + Me.Report + """ -print-settings ""fit"" "
//command looks like:
//"C:\Dev\Project\ReportOutput\SumatraPDF.exe" -print-to "\\Network\My Printer" "C:\Dev\Project\ReportOutput\card1.pdf" -print-settings "fit"
Shell(command)
Catch ex As Exception
Logger.LogError(ex)
End Try
End Sub 从命令行看起来,设置"fit“不起作用。在不打开系统打印对话框的情况下,我可以尝试从服务器端打印PDF文档的其他哪些选项?或者,我如何编辑我使用的命令,使其适用于水平布局?谢谢
发布于 2016-09-03 16:24:56
看看this吧。在第128行,您有一个const,其中包含参数的所有命令行可能值。
"content\0fitcontent\0fit-content\0";静态常量char*
= "fit page\0fit page\0fit-page\0fit width\0fit width\0fit-width\0fit“char=”fit page\0fit-page\0fit width\0fit“char
https://stackoverflow.com/questions/37659829
复制相似问题