Jump to content

Print report with a BIG JPEG


Recommended Posts

A current project I'm working requires that a "report" be printed out for every "part" produced.

Each "part" is photographed and a high quality (large) .jpg file is generated and cataloged on the hard drive. A report with this image is then printed and shipped with the product as part of a QA process.

Initially I used a command line argument to have Irfanview print the image only. This was so easy. Even printing in Landscape was simple. Of course then I realized I would probably need a little more information.

Looking at some examples of report generation and reading some of the problems others have had in the past, I figured it might be good to ask before I go stumbling around in the dark.

The only images I've seen reference to so far in report generation are objects from the front panel. Is it possible to simply add an image to standard report?

Or will I have to use HTML report?

In any case, I assume that my 3000x2000 pixel image will not auto resize to fit the page the way Irfanview does it.

If anyone has any tricks for this one, I'd love to hear them.

Link to comment

I do large image screen captures of a waveform graph sometimes. Since I started out with HTML reports in the first place all I needed to do was figure out how to make the images scale instead of being absolute size and having most of them cutoff during printing.

What has worked very well was to code a few routines which I'm sure you could use, but I don't have them around at the moment. I think I modified the append image to report vi. I added the HTML code to basically make the picture either 100% of the width, or 100% of the height--of the window. I looked the commands up on numerous html tutorials online. That way when you look at it it's sized correctly in the browser, and when you print it it gets sized correctly for the paper.

To handle printing the image landscape instead of portrait, I coded a routine that will just rotate the image 90 degrees. That way scaling to 100% height makes it full page!

Perhaps sometime I can find my routines for you.

Link to comment

I am developing a reporting application myself atm. Basically i am concatenating strings with LaTeX source code together (e.g. for a standard information header and a table for the different testresults). Main disadvantage is, that i have to create several files in a temporary folder and run the LaTeX program via system exec.

But the resulting PDF file is just very nice, including pagenumbers (which was the main reason why I dropped the idea of using HTML for reports).

Inclusion of a FP-object is planned in the near future, which is basically writing the FP-picture to a temp-file and inserting the right commands in the LaTeX source-string. Scaling of the graphic is then done by LaTeX.

Until now I am very pleased with the LV-LaTeX combo.

Perhaps i

Link to comment
I added the HTML code to basically make the picture either 100% of the width, or 100% of the height--of the window.  I looked the commands up on numerous html tutorials online.  That way when you look at it it's sized correctly in the browser, and when you print it it gets sized correctly for the paper. 

To handle printing the image landscape instead of portrait, I coded a routine that will just rotate the image 90 degrees.  That way scaling to 100% height makes it full page!

Perhaps sometime I can find my routines for you.

5393[/snapback]

Thanks for the reply.

I think you have given me some ideas. :lightbulb:

I knew there was some HTML code out there that would auto resize images. I've been to lots of webpages that do that automatically. I just needed to visualize my report more as a webpage and less as a just picture.

Link to comment
  • 4 weeks later...

I'm still familiarizing myself with how LabView formats the HTML report. But I've made some progress.

After looking at M3nth's suggestion of modifying the Append Image to Report.vi as well as trying to import external code as a way of resizing my image, I think I've settled on modifying my image prior to adding it to the report.

I discovered that I needed to crop & resize the image anyway, so the time it takes to create and save a 640x480 copy (which fits nicely onto my printed report) is nominal.

One little problem I had when I first printed my report was that Header and Footer information was being appended, only I had not asked for either and didn't know where they were coming from. Turns out Print Report.vi borrows the settings from Internet Explorer. Since I never use IE, it took a few minutes to figure out what was going on.

Although I'm pretty sure I can use some of the IMAQ tools for cropping and resizing, so far I've been really pleased with calling Irfanview and passing command line switches to it. While it's not freeware, it is an excellent piece of software with lots of documentation on command line arguments. <end plug>

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.