2012-05-05 5 views
1

내 웹 사이트 방문자는 "인쇄 미리보기"버튼을 클릭 할 수 있습니다. 자바 스크립트 코드는 윈도우 및 동적 콘텐츠를 표시하는 HTML 페이지를 생성합니다) (document.writelin 사용을 엽니 다 (기본적으로, 사용자는 보고서를 찾고 여기에 코드가 무슨 뜻인지를 보여주고있다 :.ABCpdf가 자바 스크립트로 만든 페이지에서 PDF를 만들 수 있습니까?

printerWindow = window.open(""); 
printerWindow.document.writeln("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>"); 
printerWindow.document.writeln("<html>"); 
printerWindow.document.writeln("<head>"); 
printerWindow.document.writeln("<title>Report Title</title>"); 
printerWindow.document.writeln("<link href='./css/schedule_print_preview.css' type='text/css' rel='stylesheet'>"); 
printerWindow.document.writeln("<link href='./css/schedule_printer.css' rel='stylesheet' type='text/css' media='print'>"); 
printerWindow.document.writeln("<script type='text/javascript'>"); 
printerWindow.document.writeln("function printcalc() {"); 
printerWindow.document.writeln("window.print();"); 
printerWindow.document.writeln("};"); 
printerWindow.document.writeln("<\/script>"); 
printerWindow.document.writeln("</head>"); 
printerWindow.document.writeln("<body>"); 
printerWindow.document.writeln("<div class='btns'>"); 

{ ...}

나는 방문자가 PDF에보고 저장할 수 있도록이 페이지에 "PDF 다운로드"링크를 포함하고 싶습니다.

가 ABCpdf 8.1이 가능합니까? (나는 그것을 평가하고 있습니다.) 내가 겪고있는 문제는 내가해야 할 일에 가장 가까운 예가 무엇인지 알아내는 것입니다. 어떤 제안? TIA.

답변

4

나는 당신이 할 수 있어야한다고 생각합니다. 도움이 될 C#에는 몇 가지 설정이 있습니다.

당신은 실행 자바 스크립트를 허용해야합니다

doc.HtmlOptions.UseScript = true; 

이 설정해야합니다.

그것에게 난 항상 게코 렌더링 엔진

doc.HtmlOptions.Engine = EngineType.Gecko; 
더 나은 결과를 했어로드에게

doc.HtmlOptions.Timeout = 10000; 

을 완료하는 데 더 많은 시간을 제공하기 위해 제한 시간을 설정 아마 가치