save html file to memorystream using vbscript - vbscript

Long story short, I need to be able to save .msg files to .pdf using vbscript. As I can't do this directly using Outlook, I need an intermediate step of saving the .msg to .html (using Outlook) and then save the .html to .pdf (using Word). Is there a way to save the html file into memory somehow instead of actually having to create the .html file only to delete it later (as it's only an intermediate step)? I'm looking at memorystream...am I on the right track?

Related

Original filetype of ashx file

I'm building a PHP application that uses data from a web service. I add an image to a desktop application which then saves it to the web. The web service provides image URLs using the .ashx file extension. If I put one of these in an <img src="file.ashx?pictureId=abc123">, it displays as an image.
I want to store these images. I know they'll generally be .jpg files and can run file_get_contents on this and save it as such. However, if one was a .png, for example, I'd still be saving it with a .jpg extension, so it's an assumption I don't wish to make.
I've had a look at the raw string of characters of the file and cannot see any identifying features to tell me that it's a .jpg, apart from perhaps the clue that it was created in Photoshop. Nowhere does it say what kind of file it was originally, either extension or original filename.
Is there a way of finding the original filetype of a file contained within .ashx URL?
The question doesn't make any sense. Maybe the .ashx script generates the image on the fly out of nothing and there is no "original".
The correct question is: how to find the type of the image retrieved from the .ashx URL?
Save the image into a (temporary) file then use getimagesize() to find its type (GIF, JPEG, PNG etc) and choose the correct termination for its final file name.

TFS2017: Code search in excel files

I'm using the Code Search extension/feature to look into source control files and I noticed that is not returning any results for .xls files content although is returning result for .xlt files content.
It's possible to enable the search into .xls files also?

Extract images from .swf viewer?

I'm wondering how it possible to extract images from .swf viewer?
Note that .swf file have not images itself.
For example I'm trying extract images from AVON catalogue from this link - http://avon.com.ua/PRSuite/eBrochure.page?index=1&cmpgnYrNr=201404&pageNo=0
Any ideas?
Best way is to put the .swf file in a decompiler for image extraction. Decompilers are smart enough to extract images for you and arrange them.
JPEXS Free Flash Decompiler is a more popular one
http://www.free-decompiler.com/flash/
You can extract other useful content from it as well.
Just download the .swf file from the website
A while back (like around 1999) I wrote a set of tools for Flash animations.
One of the tools is swf_dump which can be used to extract objects (i.e. write the objects in a form of script that sswf can nearly recompile...)
The tool also allows for extracting images that are inline (not downloaded dynamically by the flash animation, if so, anyway, you could as well download those images manually, you'd need the URL, though.)
The command line you can use is:
swf_dump -d my-animation.swf
Then your current folder will be littered with all the images that were found in the flash file. It extracts JPEGs and PNGs. The source can be compressed (SWF or CWF are supported.)
Now, you're on your own to compile that thing... The project is here and is in great need of updating (but Flash is kind of going out too...)
https://sourceforge.net/projects/sswf/

Having a file open automatically when the compressed folder containing it is unzipped

I have a compressed (zipped) folder with several KML files and some image files in it. I will soon make the compressed folder available to download from a web site; once the site's user downloads the file, they can unzip it. I am wondering if there is a way to make a certain one of the KML files open in Google Earth automatically as soon as the folder is unzipped (this file is linked to the other KML files in the folder, and opening it in Google Earth is a much handier way of viewing all the KML files than opening each file individually). Is there any way of implementing this? The operating system on my machine is Windows 7, in case this helps.
The act of unzipping a .zip file cannot easily be triggered to open a particular file as you describe on the file system. You would need a drop-box like mechanism with a custom application waiting for new contents in a particular folder.
However, KMZ is a zipped file which when opened by Google Earth will display the root-level KML file (typically named doc.kml) so a workable solution would be to create a single KMZ file with folder-structure as needed. The KMZ file would include a parent KML with links to the sub-KML files either as anchor links (or feature anchor) accessed via feature description and/or as network links.
The parent KML file can have in its top-level KML element an description with an index or table of contents with links to all the sub-KML files.
A working example of a feature-anchor can be found here:
http://kml-samples.googlecode.com/svn/trunk/kml/feature-anchor/feature-anchor-semi.kmz
A good description of feature anchors in action with examples can be found in Chapter 2 of the KML Handbook.

Converting Word to PDF Using SharePoint 2010 Word Automation Services

I have tried to find out the way I can put locks or disable the copy and paste on the PDF file after the conversion. I looked at the ConversionJobSettings properties but I couldn’t be able to accomplish this.
Based on what I have read, the sharepoint2010 Word Automation services API provides very limited capability in manipulating the conversion logics but is there any way I can lock down the content so that it cannot be copied?
Thank for your help
You will either need to code something up yourself or get a third party product such as this one, which allows conversion as well as PDF manipulation including security and watermarking.
Note that I worked on this product, so I am obviously biased. Having said that, it works brilliantly.
The only way to prevent copy and paste (as text) is to create image versions of the pages and saves those as a PDF.
a possible solution:
1) Use Word automation to print to a PostScript (PS) printer driver to get a .ps file
2) Use GhostScript to convert the PS to tif files
3) Create a PDF using the tif files (possibly with GhostScript too)

Resources