Я пробую библиотеку с www.pd4ml.com
, вот надрез кода....
я вытягиваю в HTML в Строковое содержание. Затем я делаю паре вещей нравится, заменяют переключатели флажками и затем выполняют его через pd4ml библиотеку для рендеринга PDF.
результат в значительной степени походит на исходную страницу....
String content = nextPage.generateResponse().contentString();
content = content.replace("Print", "");
content = content.replace("Back", "");
content = content.replace("border=\"1\"", "border=\"0\"");
content = content.replace("radio", "checkbox");
java.net.InetAddress i = java.net.InetAddress.getLocalHost();
String address = i.getHostAddress()+":53000";
content = content.replace("img src=\"/cgi-bin", "img src=\"http://"+address+"/cgi-bin");
System.out.println(content);
PD4ML html = new PD4ML();
html.setPageSize( new java.awt.Dimension(650, 700) );
html.setPageInsets( new java.awt.Insets(30, 30, 30, 30) );
html.setHtmlWidth( 750 );
html.enableImgSplit( false );
html.enableTableBreaks(true);
StringReader isr = new StringReader(content);
baos = new ByteArrayOutputStream();
html.render( isr, baos);
PDFRegForm pdfForm = (PDFRegForm)pageWithName("PDFRegForm");
pdfForm.baos = baos;
pdfForm.generateResponse();
I've seen this problem when the application directory is not set up in IIS with an application name. You can change that from the IIS manager.
long the lines of what Luke pointed out already:
Check that you are placing the global.asa file in the root of the web Site/Virtual Directory that your application is running from.
Пока все отличные советы. В противном случае будет сложно смешивать классический asp и .Net.
Хорошая исходная информация доступна на http://www.w3schools.com/ASP/asp_globalasa.asp .