Reply to topic  [ 5 posts ] 
Change embedded TIFFs to JPEGs in rtf document 
Author Message

Joined: 2013-10-08 13:58:39
Posts: 9
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


2016-11-23 17:05:17
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
Assuming Photoshop has a batch processing feature, you could do this as follows:

  1. Extract the images from the document (see this discussion viewtopic.php?f=18&t=6473)
  2. Convert the images using the batch feature
  3. Use a macro to replace the images with the converted ones

If you are already keeping your images in a folder (in some more or less systematic fashion), the first step is already done.

_________________
philip


2016-11-23 19:50:49
Profile

Joined: 2013-10-08 13:58:39
Posts: 9
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.


2016-11-23 20:18:36
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
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:

Code:
$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


2016-11-23 21:09:15
Profile

Joined: 2013-05-03 07:06:31
Posts: 103
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.


2016-12-05 14:15:42
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software