LabVIEW print front panel PDF with specific filename - pdf-generation

I'm using the Easy Print VI to print my application front panel. But I'm unable to predefine the filename and auto save it.

The "Save report to File.vi" let's you specify the name of the VI. Note that this VI does NOT work with a standard report, but with HTML. I do not have the report generation toolbox so cannot test for the rest.
Another way is to print the report with a PDF printer. I get a pop-up dialog with the standard Microsoft PDF printer but that is probably avoidable with better PDF printers.

Related

How to access Print dialog's 'Open PDF in Preview' in os x programmatically

I am building a Delphi application which opens an image and its metadata and prints it. For the Windows version I build a form to generate the PrintPreview, but in Mac I can use the Print Dialog's 'Open PDF in Preview' instead. When I click on it, a PDF file is generated and I can see it, its OK. The problem is I want to access this option directly from a button, so when the button is clicked, the PDF in Preview is opened and the user does not have to open the Print Dialog, then click the 'PDF' and then select 'Open PDF in Preview'. How can I do this?
I read about using Automator, apple scripts etc, but I still can't find it.
Is there any path this generated PDF Preview is stored, so maybe I can open it from there?...
TIA
Possible duplicate of Using Automator or Applescript or both to recursively print documents to PDF but I'll answer anyways.
To answer your question directly see the question I linked to. Basically you need to use System Events from applescript to accomplish that exactly
However, there's a quicker solution using /usr/sbin/cupsfilter. Check the man page for more.
You can call cupsfilter <an-image-file> and you'll get a PDF on stdout, courtesy of OSX's printing daemon. It looks quite configurable but I just learned about it a while ago.
If you want this to open for the user you can save it in a nice place or you can do it the one-shot way and do cupsfilter <your-image> | open -f -a "Preview" to open the PDF right up.

How to programmatically intercept OSX (10.8) print command?

Basically, if I'd like to be able to handle a print job initialization command. Like hitting Cmd+P on a document or something. I'd like to be able to access the data being printed and programmatically handle it rather than through a GUI.
Thanks!
You can possibly use the OSX automator to do what you need here. It depends on what you want to get out of the printed document. Automator allows you to create print plugins, which you can select from the system print dialog. I see you mentioned already that you don't want to use the "PDF" print menu as is, but perhaps some value can be added with extra automation in a print plugin. The plugin will create a .pdf of the printed documents, to which you can apply an automated sequence of actions.
Start /Applications/Automator
Under "Choose a type for your document:", choose "Print Plugin"
Then set up a sequence of actions you need to process your printed document. For example, you might want to do "Extract PDF Text" or "PDF to Images". Type "pdf" in the search field to see all the pdf-related actions available.
Save the automator workflow. You will only be able to give it a name, but not save it as a file in an arbitrary path.
You can use the plugin by opening the system print dialog in any given application, then dropping down the "PDF" menu in the bottom left-hand corner. You should see your plugin appear there.

programmatically take screenshot, crop section, and run OCR tools. quick solutions?

I will be writing code that takes a screenshot, crops to a small section of the screen (predefined area of screen), and then extracts the text from that cropped image (via OCR tools), and then saves the resulting text to a file. I was wondering if there is software (preferably for Windows) that can do this, or at least parts of it. I am already looking into tesseract as an OCR tool. Anyone know of software that can take the screenshot, and possibly crop a predefined region of the image.
Thanks,
-Jason
I use Greenshot, which is a very awesome tool for screenshots and according to the FAQ it supports OCR (using MODI = Microsoft Office Document Imaging) as well. However, I never got it working on my Windows machine and used Tesseract instead (for Linux, with some scripting experience, this method should be possible as well):
Download Tesseract here for Ubuntu/Debian/Windows and install it.
Download and install Greenshot
Create a new windows batch script called "Greenshot_Tesseract_OCR.bat" using a text editor like notepad or Notepad++ - and save it at a location of your choice, e.g. "C:\Users\MyUser\Scripts\Greenshot_Tesseract_OCR.bat" - with the following content (depending on the installation location of tesseract):
ECHO OFF
set arg1=%1
"C:\Program Files\Tesseract-OCR\tesseract.exe" "%arg1%" "%arg1%"
type "%arg1%.txt" | clip
Right-click the Greenshot icon in the toolbar and click "configure external command"
Add a new command with a name like "Tesseract OCR to Clipboard", select the batch script you just created as a command and as argument, use the default "{0}". Then click OK twice.
You should now be able to copy the text of a screenshot into your clipboard, with a shortcut ("Print" key in my case) and 1-2 mouse clicks (depending on your Greenshot settings)!
You can try the following open-source programs:
Greenshot for screenshots and VietOCR (a GUI frontend for Tesseract) for OCR on screenshots.

How do I convert Word files to PDF using Word 2007 programmatically?

I used to convert Word documents to PDF via Word Automation: Enumerate the CommandBars until one containing "PDFmaker" was found, enumerating its controls and executing it.
With Word 2007 this no longer works - although the PdfMaker Com Addin is installed and accessible via the Acrobat menu.
PDFmaker is required for quality reasons. Therefore I cannot use the Microsoft "Save as PDF" addin; so the SaveAs method described in another post here is not applicable.
Any ideas?
A common way to get a PDF out of Word is to print to a virtual PDF printer. I could bet you have one installed. Maybe you find the quality appropriate.
The code would be:
Application.ActivePrinter = "whatever PDF printer you've got"
ThisDocument.PrintOut OutputFileName:="c:\whatever.pdf", PrintToFile:=True

Is it possible to replace the system open file dialog?

I want to replace the standard system open file dialog with the one I wrote, that means no matter within which programs you are opening a file, my dialog will be shown instead of the standard one, is this possible?
It seems that that there is no such API provided to accomplish this, is it possible to use some hooking technique, but this has to be reliable and not to be treated as spyware by anti-virus tools?
any other options?
If this is not possible, is it possible to add to the spacebar or toolbar in the standard open file dialog a button which invokes my dialog, which allow users select a file and in turn returns the path of the selected file to the "File name" input box of the standard dialog?
Any hits, links and code examples will be appreciated.
Starting in Vista, the FileOpen/FileSave dialogs are now "Common Item Dialogs" of which IFileOpenDialog & IFileSaveDialog are the two published implementations.
Since they're just COM objects with known CLSIDs you might get away with just replacing them by re-registering using their CLSIDs. Never tried something like that, might trip all sorts of alarm bells.
Pre-Vista file dialogs can be hooked in process, but I've never come across anything about global hooks or equivalent.
If you copy a file/folder to a dialog's filename field it usually pastes the full path anyway.
For example, if you have open both a program calling the standard open/save dialog box and also have a window open at the file or path that you want to work with (open from/save to), you can simply copy the file/folder from the explorer window, and then paste into the filename field of the dialog box, and it will insert the full path of the file/folder. No custom script is required!
Alternatively, for those programs that use custom dialog boxes where this step fails, copy the same file/folder in the window into the address bar of the same window (assuming it is visible). This will paste the full path, which you can copy again, and then paste this full path into the custom dialog box. I often use this when creating Office hyperlinks (Ctrl+K), because the Insert Hyperlink dialog does not work for the first method.
You can also use similar methods but paste into address bar fields and it works.

Resources