문제

PDF 문서를 인쇄하려고 할 때 Adobe Reader와 Foxit Reader가 모두 문제가 있습니다. 두 문제 모두 다르지만 두 가지 솔루션이 내 문제를 해결할 수 있습니다.

다음 코드를 사용하여 인쇄하려고 할 때 Adobe Reader가있는 문제는 기본 프린터 만 네트워크 프린터에 인쇄하지 않고 기본 프린터 만 인쇄하지 않는다는 것입니다.

Dim AdobeReader As New Process
AdobeReader.StartInfo.CreateNoWindow = False
AdobeReader.StartInfo.Verb = "print"
AdobeReader.StartInfo.FileName = SQLdr("DocumentName") & ".pdf"
Select Case SQLdr("Priority")
    Case 1
        AdobeReader.StartInfo.Arguments = String.Format("/t {0} {1}", SQLdr("DocumentName") & ".pdf", printPriority1)
    Case 2
        AdobeReader.StartInfo.Arguments = String.Format("/t {0} {1}", SQLdr("DocumentName") & ".pdf", printPriority2)
    Case 3
        AdobeReader.StartInfo.Arguments = String.Format("/t {0} {1}", SQLdr("DocumentName") & ".pdf", printPriority3)
    Case 4
        AdobeReader.StartInfo.Arguments = String.Format("/t {0} {1}", SQLdr("DocumentName") & ".pdf", printPriority4)
    Case 5
        AdobeReader.StartInfo.Arguments = String.Format("/t {0} {1}", SQLdr("DocumentName") & ".pdf", printPriority5)
End Select

AdobeReader.Start()
AdobeReader.WaitForExit(10000)
AdobeReader.Close()
.

문서 이름과 프린터 이름 주변의 큰 따옴표로 위의 코드를 시도했습니다.

Foxit이있는 문제는 다음 코드로 인쇄하고 인쇄 할 때 FoxitReader.start 에서이 작업을 위해 지정된 파일과 연관되지 않습니다.

Dim FoxItReader As New Process
FoxItReader.StartInfo.CreateNoWindow = False
FoxItReader.StartInfo.Verb = "print"
FoxItReader.StartInfo.FileName = "C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe"
Select Case SQLdr("Priority")
    Case 1
        FoxItReader.StartInfo.Arguments = String.Format("/t {0} {1}", SQLdr("DocumentName") & ".pdf", printPriority1)
    Case 2
        FoxItReader.StartInfo.Arguments = String.Format("/t {0} {1}", SQLdr("DocumentName") & ".pdf", printPriority2)
    Case 3
        FoxItReader.StartInfo.Arguments = String.Format("/t {0} {1}", SQLdr("DocumentName") & ".pdf", printPriority3)
    Case 4
        FoxItReader.StartInfo.Arguments = String.Format("/t {0} {1}", SQLdr("DocumentName") & ".pdf", printPriority4)
    Case 5
        FoxItReader.StartInfo.Arguments = String.Format("/t {0} {1}", SQLdr("DocumentName") & ".pdf", printPriority5)
End Select

FoxItReader.Start()
FoxItReader.WaitForExit(10000)
FoxItReader.Close()
.

위의 코드와 함께 변수 주위에 큰 따옴표가 있지만 작동하지 않았습니다.

이 문제에 대한 도움이 많이 감사 할 것입니다.

편집

또한 프린터와 PDF 파일이 모두 서버에 있으므로 네트워크 경로 (\\ server \ file.pdf)를 통해 공유 프린터와 PDF를 사용하려고합니다.

도움이 되었습니까?

해결책

"Nofollow"> PDFSHARP 에서하는 작업을 살펴 보겠습니다. Adobe Reader / Acrobat을 사용하여 인쇄하려면 : http://pdfsharp.codeplex.com/sourcecontrol/changeset/view/51421#707803.

나는 그들이 기본 프린터 문제를 그들의 의견에서 발견했다고 믿습니다 :

// AcroRd32.exe /t path printername drivername portname    Executes the reader and prints a file
//                                                         while suppressing the Acrobat print
//                                                         dialog box, then terminating the Reader.
//
// The four parameters of the /t option evaluate to strings.
// printername     The name of the Printer.
// drivername      Your printer drivers name i.e. whatever apperars in the Driver Used box when viewing printer properties.
// portname        The printers port. portname cannot contain any "/" characters; if it does, output is routed to
//                 the default port for that printer.
.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top