Hi
I have a document that is growing in size quickly. It has hundreds of screen grabs in it, and they all seem to have come in (through screenshot to clipboard, paste into document) as TIFFs.
Is there any easy way to convert these TIFFs to JPGs? It is not worth the time to go through the document, paste into, say Photoshop, save as JPG, and then import into the document, but if there was an easy way to do this, it would be so cool.
I know how to change the size of a pdf using various tools, but I don't know of any similar tools for rtf documents.
Thanks
Change embedded TIFFs to JPEGs in rtf document
Re: Change embedded TIFFs to JPEGs in rtf document
Assuming Photoshop has a batch processing feature, you could do this as follows:
- Extract the images from the document (see this discussion https://www.nisus.com/forum/viewtopic.php?f=18&t=6473)
- Convert the images using the batch feature
- Use a macro to replace the images with the converted ones
philip
Re: Change embedded TIFFs to JPEGs in rtf document
Thanks, Phillip. I'll look into this. I haven't scripted Nisus Writer before. And, yes, Photoshop can be scripted -- there are lots of limitations, but it can be made to work.
Re: Change embedded TIFFs to JPEGs in rtf document
I don't know Photoshop. I use Graphic Converter. And it allows batch conversion as a simple operation (no scripting needed).
As for Nisus, a macro to replace inline images of one type with images with the same names, and an extension '.jpg' would look something like this:
As for Nisus, a macro to replace inline images of one type with images with the same names, and an extension '.jpg' would look something like this:
Code: Select all
$jpegFolderPath = Choose Folder # ... or specify
$doc = Document.active
foreach $img in $doc.allImages
$jpegName = $img.name.filePathByChangingExtension 'jpg'
$jpeg = Image.newFromFileAtPath $jpegFolderPath.filePathByAppendingComponent($jpegName)
$text = $img.anchorText
$loc = $img.anchorTextRange.location
$text.deleteInRange $img.anchorTextRange
$text.insertAtIndex $loc, $jpeg
end
philip
Re: Change embedded TIFFs to JPEGs in rtf document
You do not need to use Photoshop; the built-in "Automator" program can batch convert an entire set of files.
What I would do is save your Nisus document as file type "RTFD". This will generate a file that actually has all of your images inside a folder inside the file. You can then batch process all of those images, and use the macro provided.
If you haven't used Automator before, it is pretty easy, especially if you know how to script photoshop already. But no need for Photoshop at all.
What I would do is save your Nisus document as file type "RTFD". This will generate a file that actually has all of your images inside a folder inside the file. You can then batch process all of those images, and use the macro provided.
If you haven't used Automator before, it is pretty easy, especially if you know how to script photoshop already. But no need for Photoshop at all.