document

How does jQuery.post() deal with Content-Disposition: attachment?

◇◆丶佛笑我妖孽 提交于 2019-12-02 06:39:48
Going slightly crazy here. I'm making an Ajax call using jQuery.post as follows: $.post('php/print.php',{data:dS},function(res){... },"text"); I'm returning from print.php (as a test): header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment;Filename=test.doc"); echo "<html>"; echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">"; echo "<body>"; echo "Testing-2-3!"; echo "</body>"; echo "</html>"; The data is coming through fine according to Firebug, including the headers. But how do I get the browser (Firefox, in this instance)

How to set background image in PdfPCell in iText?

微笑、不失礼 提交于 2019-12-02 06:36:26
I am currently using iText to generate PDF reports. I want to set a medium size image as a background in PdfPCell instead of using background color. Is this possible? You can find an example on how to do this with iText 5.5.1 here . You need to create your own implementation of the PdfPCellEvent interface, for instance: class ImageBackgroundEvent implements PdfPCellEvent { protected Image image; public ImageBackgroundEvent(Image image) { this.image = image; } public void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases) { try { PdfContentByte cb = canvases[PdfPTable

Accessing IBOutlet from other classes

馋奶兔 提交于 2019-12-02 05:40:45
问题 I have a document based cocoa application with an item in the application menu hooked up to an IBAction . Clicking the item needs to perform a task that uses an IBOutlet in the main nib file which is using another class, MyDocument . Creating 2 objects of the same class, one in each nib seems to not be working. How can I access the outlet? 回答1: Actions for menu items are often sent to the first responder so that whatever is currently selected can act on it. It sounds like this action is

jQuery onclick all images in body

为君一笑 提交于 2019-12-02 05:10:29
问题 English isnt my native language so bear with me. Im trying to make it so that when a user clicks any image on my site a gallery sort of div will become visible containing the image at its fullest size. The way I've done now is; var image = $("body > image"); image.on('click', function(){ var imageURL = $(this).attr('src'); backgroundCurtain.css({"display": "block"}); imageResized.attr("src", imageURL); var imageWidth = imageResized.width(); pictureInner.css({"width" : imageWidth}); }); This

Accessing IBOutlet from other classes

[亡魂溺海] 提交于 2019-12-02 03:18:34
I have a document based cocoa application with an item in the application menu hooked up to an IBAction . Clicking the item needs to perform a task that uses an IBOutlet in the main nib file which is using another class, MyDocument . Creating 2 objects of the same class, one in each nib seems to not be working. How can I access the outlet? Actions for menu items are often sent to the first responder so that whatever is currently selected can act on it. It sounds like this action is something that works on the current document, then it should be implemented by the document. In this case have

Adding custom shapes to JTextpane and saved to new Word document

有些话、适合烂在心里 提交于 2019-12-02 02:55:39
If I load a Word document into a JTextPane , is there a way I could drop a custom shape in it, then save it as a new Word document? The results I'm looking for are just like dropping a shape anywhere onto the document using Insert-> Shapes in MS Word. docx4all is a Swing-based docx editor. Like DocxEditorKit, it is built on top of docx4j. You'd need to extend it to support the functionality you are describing. You can try to extend the DocxEditorKit http://java-sl.com/docx_editor_kit.html adding your feature there 来源: https://stackoverflow.com/questions/15611562/adding-custom-shapes-to

Opening Word Document on Client Side from Asp.net Application

依然范特西╮ 提交于 2019-12-02 02:51:19
We need to open a word document which is located on a server on the clients machine using Microsoft Word. The solution is working locally however when deployed on server then only thing that happens is that the winword.exe is started on the server. Is this possible to do using interop or javascript? this is the code till now Microsoft.Office.Interop.Word.ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass(); object file = FilePath + FileName; lblError.Text = lblError.Text + file.ToString(); object readOnly = false; object objTrue = true; object missing = System

PHP domDocument to remove child nodes of a child node

断了今生、忘了曾经 提交于 2019-12-02 01:54:33
How do I remove a parent node of a child node, but keep all the children? The XML file is this: <?xml version='1.0'?> <products> <product> <ItemId>531<ItemId> <modelNumber>00000</modelNumber> <categoryPath> <category><name>Category A</name></category> <category><name>Category B</name></category> <category><name>Category C</name></category> <category><name>Category D</name></category> <category><name>Category E</name></category> </categoryPath> </product> </products> Basically, I need to remove the categoryPath node and the category node, but keep all of the name nodes inside of the product

jQuery onclick all images in body

白昼怎懂夜的黑 提交于 2019-12-02 01:33:10
English isnt my native language so bear with me. Im trying to make it so that when a user clicks any image on my site a gallery sort of div will become visible containing the image at its fullest size. The way I've done now is; var image = $("body > image"); image.on('click', function(){ var imageURL = $(this).attr('src'); backgroundCurtain.css({"display": "block"}); imageResized.attr("src", imageURL); var imageWidth = imageResized.width(); pictureInner.css({"width" : imageWidth}); }); This isn't working and to be honest I wasn't expecting it to work. How do I call it so that every image

Check if the browser supports document.querySelectorAll in JavaScript

岁酱吖の 提交于 2019-12-02 00:52:49
Now although most modern browser support document.querySelectorAll() , you may run into problems with older versions of Internet Explorer. The obvious way of checking if the browser supports a function would be: if(document.querySelectorAll){ //some random code } But from what I understand some browsers like (IE8) don't support certain properties, like ' body * '. Is there a better way to check if document.querySelectorAll('body *') will actually work? document.querySelectorAll will thrown on any unsupported selector so you can simply use a try-catch block. test Browser support or not ,