Search Results

Search found 8942 results on 358 pages for 'print r'.

Page 21/358 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • How to print a pdf in a new tab? [migrated]

    - by TheDuke777
    I need to print a pdf by opening it in a new window. I've looked at tutorials for days, but nothing is working. I've tried many approaches, but this is the most recent: <!DOCTYPE html> <html> <head> <script type="text/javascript"> function print() { window.getElementById("pdf").focus(); window.getElementById("pdf").print(); } </script> </head> <body onload="print()"> <embed id="pdf" src="http://path/to/file" /> </body> </html> The page loads fine, with the pdf embedded. But it won't print, and I feel like I've been beating my head against a brick wall trying to figure this out. How can I get this to work? I'm willing to try anything at this point.

    Read the article

  • C# PrintPreviewDialog Modification possible?

    - by C. Griffin
    Currently, what I'm doing is this: Using the built-in .NET PrintPreviewDialog Attaching my own Click handler to the Print button, which allows for the user to select the printer before finally printing. This all WORKS, HOWEVER, the OnprintToolStripButtonClick event is still sending the document to the default printer BEFORE the user gets to choose the actual printer and click Print (which works, but they're getting an extra copy on the default printer first from the old Handler). Can I remove this built-in Click handler? I've tried the other methods mentioned on here in regards to using an EventHandlerList to remove the handlers, but it doesn't work for the built-in printing event. Here is a copy of my current code in case it helps clarify: // ... Irrelevant code before this private PrintPreviewDialog ppdlg; ToolStrip ts = new ToolStrip(); ts.Name = "wrongToolStrip"; foreach (Control ctl in ppdlg.Controls) { if (ctl.Name.Equals("toolStrip1")) { ts = ctl as ToolStrip; break; } } ToolStripButton printButton = new ToolStripButton(); foreach (ToolStripItem tsi in ts.Items) { if (tsi.Name.Equals("printToolStripButton")) { printButton = tsi as ToolStripButton; } } printButton.Click += new EventHandler(this.SelectPrinterAfterPreview); // ... Irrelevant code afterwards omitted // Here is the Handler for choosing a Printer that gets called after the // PrintPreviewDialog's "Print" button is clicked. private void SelectPrinterAfterPreview(object sender, EventArgs e) { frmMainPage frmMain = (frmMainPage)this.MdiParent; if (frmMain.printDialog1.ShowDialog() == DialogResult.OK) { pd.PrinterSettings.PrinterName = frmMain.printDialog1.PrinterSettings.PrinterName; pd.PrinterSettings.Copies = frmMain.printDialog1.PrinterSettings.Copies; pd.Print(); } }

    Read the article

  • Printing a sideways triangle in java

    - by Will
    I'm trying to print a sideways triangle in java. If the user enters 5, the output should be: * *** ***** *** * If the user enters 6, the output should be: * *** ***** ***** *** * I've gotten it to work for the case when the user enters 5, 3, or 1 but my code seems to work for those three cases only. I was wondering if anyone could help me get my code working for more cases. Here it is: public void printArrow( int n ) { int asterisks = 1; for ( int i = 0; i <= n/2; i++ ) { for ( int j = i; j < asterisks; j++ ) { System.out.print( "*" ); } asterisks += 3; System.out.println(); } asterisks = asterisks / 2 - 2; for ( int i = 0; i < n/2; i++ ) { for ( int k = i; k < asterisks; k++ ) { System.out.print( "*" ); } if ( i == 1 ) { System.out.print( "*" ); } asterisks -= 2; System.out.println(); } }

    Read the article

  • OS X printing to HP Photosmart black only

    - by churnd
    When you print something to a Photosmart printer in OS X, by default it prints color. If you want black and white, you have to manually change the settings. How do I fix it to where it prints black and white by default, and if you want color, you have to change the settings? More specifically, I want the default to be black and white that uses only the black cartridge.

    Read the article

  • Groovy pretty print XmlSlurper output from HTML?

    - by Misha Koshelev
    Dear All: I am using several different versions to do this but all seem to result in this error: [Fatal Error] :1:171: The prefix "xmlns" cannot be bound to any namespace explicitly; neither can the namespace for "xmlns" be bound to any prefix explicitly. I load html as: // Load html file def fis=new FileInputStream("2.html") def html=new XmlSlurper(new org.cyberneko.html.parsers.SAXParser()).parseText(fis.text) Versions I've tried: http://johnrellis.blogspot.com/2009/08/hmmm_04.html import groovy.xml.StreamingMarkupBuilder import groovy.xml.XmlUtil def streamingMarkupBuilder=new StreamingMarkupBuilder() println XmlUtil.serialize(streamingMarkupBuilder.bind{mkp.yield html}) http://old.nabble.com/How-to-print-XmlSlurper%27s-NodeChild-with-indentation--td16857110.html // Output import groovy.xml.MarkupBuilder import groovy.xml.StreamingMarkupBuilder import groovy.util.XmlNodePrinter import groovy.util.slurpersupport.NodeChild def printNode(NodeChild node) { def writer = new StringWriter() writer << new StreamingMarkupBuilder().bind { mkp.declareNamespace('':node[0].namespaceURI()) mkp.yield node } new XmlNodePrinter().print(new XmlParser().parseText(writer.toString())) } Any advice? Thank you! Misha

    Read the article

  • How to print out returned message from HttpResponse?

    - by chobo2
    Hi I have this code on my andriod phone. URI uri = new URI(url); HttpPost post = new HttpPost(uri); HttpClient client = new DefaultHttpClient(); HttpResponse response = client.execute(post); I have a asp.net webform application that has in the page load this Response.Output.Write("It worked"); I want to grab this Response from the HttpReponse and print it out. How do I do this? I tried response.getEntity().toString() but it just seems to print out the address in memory. Thanks

    Read the article

  • print matrix in dialog box

    - by Edan
    Hello, I'm having a little difficulty to print a matrix array on dialog box. The matrix is integer and as far as i understood i need to change it into string? anyway, here's the code: public void print_Matrix(int row, int column) { for (int i = 0; i <= row; i++) { for (int j = 0; j <= column; j++) { JOptionPane.showMessageDialog(null, matrix_Of_Life); } } what I need to do in order to print array into dialog box? thanks.

    Read the article

  • MS Access Print Report using VBA

    - by LanguaFlash
    I have a very VBA intensive report. When I preview it everything is great but when I print it after previewing things go wacky. I have spent many hours narrowing down the possibilities and I have conclude with a certain level of confidence that it is a but in MS Access. Up to this point my method for printing reports was to open the report using docmd.openreport "report". I then use the docmd.printout command so that I can set the page range, collation etc. Is there a way to print a report directly and still be able to set options like page rage, collate etc without doing a preview first? Thanks, Jeff

    Read the article

  • Qt4: QPrinter / QPainter only print the first document

    - by hurikhan77
    In Qt4, I'm initializing the printer in the main.cpp in the following way: mw->printer = new QPrinter(QPrinter::HighResolution); mw->printer->setPaperSize(QPrinter::A5); mw->printer->setNumCopies(2); mw->printer->setColorMode(QPrinter::GrayScale); QPrintDialog *dialog = new QPrintDialog(mw->printer, mw); dialog->setWindowTitle(QObject::tr("Printer Setup")); if (dialog->exec() == QDialog::Accepted) { mw->printer->setFullPage(TRUE); return a.exec (); } This works fine for printing the first document from the application: qDebug("Printing"); QPainter p; if (!p.begin(printer)) { qDebug("Printing aborted"); return; } Q3PaintDeviceMetrics metrics(p.device()); int dpiy = metrics.logicalDpiY(); int dpix = metrics.logicalDpiX(); int tmargin = (int) ((marginTop / 2.54) * dpiy); int bmargin = (int) ((marginBottom / 2.54) * dpiy); int lmargin = (int) ((marginLeft / 2.54) * dpix); int rmargin = (int) ((marginRight / 2.54) * dpix); QRect body(lmargin, tmargin, metrics.width() - (lmargin + rmargin), metrics.height() - (tmargin + bmargin)); QString document; /* ... app logic to write a richtext document */ Q3SimpleRichText richText(QString("<qt>%1</qt>").arg(document), QFont("Arial", fontSize)); richText.setWidth(&p, body.width()); QRect view(body); int page = 1; do { // draw text richText.draw(&p, body.left(), body.top(), view, colorGroup()); view.moveBy(0, body.height()); p.translate(0, -body.height()); // insert page number p.drawText(view.right() - p.fontMetrics().width(QString::number(page)), view.bottom() + p.fontMetrics().ascent() + 5, QString::number(page)); // exit loop on last page if (view.top () >= richText.height ()) break; printer->newPage(); page++; } while (TRUE); if (!p.end()) qDebug("Print painter yielded failure"); But when this routine runs the second time, it does not print the document. It will just print an empty page but still with the page number on it. This worked fine before with Qt3.

    Read the article

  • Print ms access data in vb.net

    - by user225269
    How do I print the ms access data(.mdb) in vb.net? Here is the code that I'm using to view the data in the form. What I want to do is to be able to print what is currently being viewed. Perhaps automatically save the .pdf file and the pdf viewer installed on the system will open that newly generated pdf file Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\search.mdb") Dim cmd As OleDbCommand = New OleDbCommand("Select * from GH where NAME= '" & TextBox6.Text & "' ", cn) cn.Open() Dim rdr As OleDbDataReader rdr = cmd.ExecuteReader If rdr.HasRows Then rdr.Read() NoAcc = rdr("NAME") If (TextBox6.Text = NoAcc) Then TextBox1.Text = rdr("IDNUMBER") If (TextBox6.Text = NoAcc) Then TextBox7.Text = rdr("DEPARTMENT") If (TextBox6.Text = NoAcc) Then TextBox8.Text = rdr("COURSE") End If -some sites for beginners regarding this topic would help a lot:)

    Read the article

  • php echo doesnt print newlines

    - by Skun
    Hey ! I started doing a new project in PHP / MySql . The Aim of this project is to manage articles for a magazine that i am the editor of. So the content of the articles, i decided i would store with the "TEXT" column type of MySql Now when i retrieve this column and print it with echo, the newlines are not there. Its all on the same line. $resset = mysql_query("select txt from articles where id = 1"); $row = mysql_fetch_assoc($resset); $txt = $row['txt']; echo $txt; //doesnt print it as it is in the database as it was typed (multiline) Find below, the text as it looks in the database and as it looks when it is echoed But within the database, its stored with newlines. Has anybody else encountered this problem? Please help me as my project depends on this :|

    Read the article

  • Print Several Outlook MailItems

    - by David Souther
    I have a pst that has a bunch of emails I want to print using the Microsoft Document Image Writer so that I have a folder, //lawyers/ediscovery/emails/ that has 00001.tiff 00002.tiff etc. In Word or Excel, I can pass the Workbook or Document a filepath to the PrintOut method, but the Outlook MailItem interop's PrintOut doesn't take any arguments, instead only uses the default printer's attributies. I don't have time to type the Bates number for every email (thousands to tens of thousands). Any help on how to tell Outlook where to print to?

    Read the article

  • Reportviewer - Print report - matrix report expanding horizontally to multiple pages, avoid repeating row header

    - by abc0077
    I am generating a matrix report dynamically using report viewer version 9.0 in visual studio 2010. If i export save and print then it works normally. If there more columns report expands horizontally across mutiple pages. If i give Print option available in the toolbar of the report viewer. The columns are moved to second page which is correct but the row headers (product 1, product 2) should not be repeated in the second page.In the second page report should have all details except the product information. I am also interested to know whether it is the functionality of this version report viewer.

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >