Convert Doc,Docx to TIFF with delphi - delphi

Hi
How can i convert doc,docx to TIFF whith delphi?

In short, you can't.
Doc and TIFF are two completely different things. It's not like converting from BMP to TIFF (two image formats), or WAV to MP3 (two audio formats). For very limited Word documents, I suppose you could run Word through OLE automation (or maybe even embed Word in your application for better control), then take a screenshot, but I think your problems runs deeper than that. Maybe you could provide some more info about what you try to achieve?

I've done it from within Word, however the code is long lost I'm sorry.
I created an Office plugin using the Add-in Express Component.
I used Word automation to convert the current document to RTF, used WP-Tools to render, which gave me the bitmap for each page. Finally I used GDI+ to create the multi-page TIFF.

The standard trick is like with word to pdf: find a virtual printer that outputs tiffs, and instrument word over OLE to print to the virtual printer.
If I put "tiff printer virtual" in google, I see quite some hits. (not all free though, and of course it complicates installation to use two programs (word+printer) to do this)

Word is not able to save its documents to TIFF format. Your best options are to use third party software which can do that. Just google for Doc to Tiff.

When looking for tools to do this, you should also be aware that not all TIFF files are faxable. TIFF files can contain a whole range of image formats and sizes. You need to find a tool which can convert your document to monochrome bitmaps 1728 pixels wide, with the page images each in a single strip and with a compression method supported by your fax software.

A good fax software usually comes with a fax printer driver, check with the maker of your fax software if they have one. With a driver you can simply use OLE Automation to make Word print the document to this driver. The fax software we use expects the fax number and other parameters embedded in the text like this: ##NUMBER12345678##

Related

Old JPG files only work with VB6 leadtools

I have images that I wanna show it on the web. The extension of the image is .JPG. If you open the file in notepad it starts with LTRI. But that page is not working on browser (even not working on Photos/Paint app of windows 10). It only works on VB6 LeadTools. How can I convert this image? File metadata is below,
You'll need to use the LeadTools libraries. You'll need to register to their site.
I haven't seen anyone else supporting that format, that is proprietary (as written by #Selvin).
Then the code should be easy:
using (RasterCodecs codecs = new RasterCodecs())
{
var image = codecs.Load("yourimage.ext");
// 0 should means "whatever bit format is appropriate"
codecs.Save(image, "out.jpg", Leadtools.RasterImageFormat.Jpeg, 0);
}
The answer posted by xanatos is correct. This appears to be a 1-bit LEAD CMP image file.
We would like to add the following details:
If the images are indeed 1-bit CMP, they would be pure black-and-white, and they would be lossless (unlike color CMP and common JPEG, which are usually lossy formats).
Naming the file aa.JPG is incorrect, since the recommended extension for LEAD images is “.CMP”. However, when using our SDK, the correct format is detected regardless of the file name or its extension.
Converting 1-bit images to JPEG is not recommended, since JPEG files are more suited for full-color images. It’s better to save them as PNG, TIFF or other lossless formats. (The LEADTOOLS SDK supports many such formats).
Using lossless compression shouldn’t produce large files since 1-bit images contain a lot less data than full-color images.
When using the free evaluation of our SDK, technical support is free through chat and email, so feel free to contact us with any questions you have.

Convert HTML to TIFF or printable poster

I want to make a website that people come and type a sentence and I make a poster out of it, print it, and send it to them.
I know I can make a box with html divs and color it and put some web font, but My questions are:
How do I go from HTML to TIFF ( I've read TIFF is the best format for poster print)
given that dpi on web is a lot lower than posters, how do I increase the dpi on generating the poster? Can I use some sort of library on the server?
What are the drawbacks of using web fonts? if they have large enough font size?
Also how do companies like zazzle, mixbook, shutterfly go about putting font on the image and printing it large?
My Original plan was to use Rails, are there any useful Gems that can help me?
I see Convert Html to a Printable Image people advice converting to PDF, wouldn't it destroy the quality of the poster?
Any other advice would be appreciated.
I think it will be useful for you https://github.com/csquared/IMGKit
And look at http://www.imagemagick.org/- for image processing. It has ruby wrapper http://rmagick.rubyforge.org/

Derive Text, Images, and LaTeX Equations from Websites

Would it be possible to derive the text, images, and LaTeX equations from a particular website so that you can directly customize your own PDF without having the objects blurry? Only the image will have a fixed resolution.
I realize that there are a couple ways of generating a PDF indirectly. Attempting to render a PDF from Wolfram MathWorld on the Riemann Zeta Function, for instance, would be possible by printing and saving it as a PDF via Chrome, but as you zoom in more closely, the LaTeX equations and text naturally become blurry. I tried downloading "Wolfram's CDF Player," but it contains only the syntax for Mathematica's libraries - not the helpful explanations that the Wolfram MathWorld provides. What would be required for me to extract the text, images, and LaTeX equations in a PDF file wihtout having them blurry?
Unless you have access to the LaTeX source that was used to produce the images in a way that isn't apparent from your question, the answer is "you cannot." Casual inspection of the website linked implies that the LaTeX that is used to produce the equations is not readily available (it's probably on a backend system somewhere that produces the images that get put on the web server).
To a browser, it's just an image. The method by which the image was produced is irrelevant to how it appears on the web page, and how it would appear in a PDF (ie. more pixelated than desired).
Note that if a website uses a vector-graphics format like SVG instead of a pixel based format like PNG or JPEG, then those will translate to PDF cleanly, and will zoom nicely. That's a choice that would be made by the webmaster of the site in question.
Inspecting the source reveals that the gifs depicting each equation have alt-text that approximates the LaTeX that would render them (it might be Mathematica code--I'm not familiar with Wolfram's tools). Extracting a reasonable source wouldn't be impossible, but it would be hard. The site is laid out with tables, so even with something like beautiful soup parsing the HTML could be tricky. Some equations are broken up into different gifs, so parsing them would be even trickier. You'd also have to convert from whatever the alt-text is to LaTeX.
All in all, if you don't need to do a zillion pages, I'd suggest copy-pasting the text, saving the images, grabbing the alt-text of each image and doing the converting yourself.
For the given example, you could download the Mathematica notebook for that page. Maybe it is possible to parse something from that.

Edit PDF documents in Delphi

We have a requirement to add the ability to edit PDF documents witin a Delphi application.
I.e. given a PDF document, open it and generate a form with edit boxes on it which the user can use to update the PDF document.
Can anyone suggest a third part component that would provide this functionality or suggest some way of achieving this.
Thanks
I use QuickPDF. Well documented, lots of examples, good support. However updating text in a PDF is an art, not a science, and unless you have full control over the producer of the PDF you may find it hard to do in the general case. For example: I have seen PDFs where text is formed from individual characters, each inserted at a specific location, so hard to edit as words; and of course in some PDFs the 'text' is actually an image of text, requiring OCR before you can edit it.
You can try Gnostice PDFtoolkit.
DISCLAIMER: I work for Gnostice.
Take a look at Amyuni PDF Creator ActiveX, it is supported in 32 bit and 64 bit applications, you may find it useful now that Delphi has a 64 compiler.
Usual disclaimer applies

How can I get summary information from images?

How can I get the summary information for file images in Delphi?
You will have to use parsers for each file type. The simple solution would be to use something like GraphicEx and to load each supported image into a temporary object, extract the information you want then dispose of it.
For EXIF information (the information attached by modern day cameras) you might want to use a different component. I know there are a few components floating around that will give you access to this special format, however this data is not supported by all image types and is normally seen in JPEG files.
You don't need anything.
It's included in Windows (Win32 COM)
See on Win32 api group (classic question...)

Resources