Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > PDF

Notices

Reply
 
Thread Tools Search this Thread
Old 03-03-2010, 04:28 PM   #1
CoolDragon
Addict
CoolDragon doesn't litterCoolDragon doesn't litter
 
Posts: 232
Karma: 122
Join Date: Feb 2010
Device: none
Non-English / Unicode PDF metadata?

How do I add/edit and save non-English/Unicode PDF metadata? I tried some PDF metadata editor but none worked.
CoolDragon is offline   Reply With Quote
Old 03-03-2010, 04:36 PM   #2
joblack
Wizard
joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.
 
Posts: 1,272
Karma: 1418786
Join Date: Jul 2006
Location: Somewhere on earth
Device: Kindle Paperwhite, Kindle DX, JBC, Onyx M92
Quote:
Originally Posted by CoolDragon View Post
How do I add/edit and save non-English/Unicode PDF metadata? I tried some PDF metadata editor but none worked.
I thought it's UTF16 (and not UTF8) so you might try this.
joblack is offline   Reply With Quote
Old 03-03-2010, 04:52 PM   #3
CoolDragon
Addict
CoolDragon doesn't litterCoolDragon doesn't litter
 
Posts: 232
Karma: 122
Join Date: Feb 2010
Device: none
How do I specify the encoding of the metadata to be UTF16?
CoolDragon is offline   Reply With Quote
Old 03-03-2010, 05:46 PM   #4
joblack
Wizard
joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.
 
Posts: 1,272
Karma: 1418786
Join Date: Jul 2006
Location: Somewhere on earth
Device: Kindle Paperwhite, Kindle DX, JBC, Onyx M92
Quote:
Originally Posted by CoolDragon View Post
How do I specify the encoding of the metadata to be UTF16?
Depends on the editor - some of the may not have the option.
joblack is offline   Reply With Quote
Old 03-03-2010, 07:13 PM   #5
CoolDragon
Addict
CoolDragon doesn't litterCoolDragon doesn't litter
 
Posts: 232
Karma: 122
Join Date: Feb 2010
Device: none
Someone can recommend any metadata editor which can specify the encoding?
CoolDragon is offline   Reply With Quote
Old 03-03-2010, 08:12 PM   #6
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
I just tested with calibre's ebook-meta command line program, and it did fine with unicode characters.

E.g., I put in:

ebook-meta Temp.pdf --title="ἀἐἠ"

And sure, enough, the title became ἀἐἠ.

Of course, you may have a problem if your shell/terminal/command line prompt doesn't support unicode input...

I imagine you could do it through calibre's GUI too, though for some reason, calibre's GUI confuses me more than using the command line does (and doesn't give me control over the file name and where it goes, which is frustrating)... so I prefer to use the command line tools.

Your mileage may vary.

Last edited by frabjous; 03-03-2010 at 08:16 PM.
frabjous is offline   Reply With Quote
Old 03-03-2010, 08:47 PM   #7
joblack
Wizard
joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.
 
Posts: 1,272
Karma: 1418786
Join Date: Jul 2006
Location: Somewhere on earth
Device: Kindle Paperwhite, Kindle DX, JBC, Onyx M92
Quote:
Originally Posted by CoolDragon View Post
How do I add/edit and save non-English/Unicode PDF metadata? I tried some PDF metadata editor but none worked.
Just remembered - perhaps your fonts just doesn't support these characters.
joblack is offline   Reply With Quote
Old 03-16-2010, 07:52 PM   #8
CoolDragon
Addict
CoolDragon doesn't litterCoolDragon doesn't litter
 
Posts: 232
Karma: 122
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by joblack View Post
Just remembered - perhaps your fonts just doesn't support these characters.
OK, out of several PDF metadata editors, only Calibre worked for this purpose. The reason is that all other programs don't write Unicode metadata into the file. But I don't want to install Calibre for just this purpose. So I wrote my own perl script which uses pdftk.

I will just post it here in case someone need it:

Code:
#!/bin/perl

use utf8;
use Encode;

binmode(STDOUT, ":utf8");

$numArgs = $#ARGV + 1;

if ( $numArgs > 1 ) {

    open(INFOFILE, "> info.tmp") or die "Cannot open ./info.tmp!\n";

    print INFOFILE "InfoKey: Title\n";
    print INFOFILE "InfoValue: ";
    $title = $ARGV[1];
    $title = decode('gb2312', $title);
    for $char ( split //, $title ) {
        print INFOFILE "&#",ord($char),";";
    }
    print INFOFILE "\n";

    print INFOFILE "InfoKey: Author\n";
    print INFOFILE "InfoValue: ";
    $author = $ARGV[2];
    $author = decode('gb2312', $author);
    for $char ( split //, $author ) {
        print INFOFILE "&#",ord($char),";";
    }
    print INFOFILE "\n";

    close(INFOFILE);
    system("pdftk $ARGV[0] update_info info.tmp output $ARGV[0].update.pdf");
    system("rm info.tmp");
} else {
    print "Usage: pdfmeta <in.pdf> <title> [author]";
}
CoolDragon is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Metadata to specify default language is English? kjk ePub 4 06-22-2010 04:05 PM
How to create non-embedded Unicode EPUB,LRF,TXT,RTF,PDF alexmobile Sony Reader 1 09-23-2009 10:04 PM
English News RSS PDF yunhaid iRex 8 05-27-2007 10:06 PM
English News RSS PDF yunhaid Sony Reader 0 05-24-2007 09:30 PM
Non-English PDF problem? each Sony Reader 8 10-06-2006 06:55 AM


All times are GMT -4. The time now is 09:17 AM.


MobileRead.com is a privately owned, operated and funded community.