Skip to main content.
home | support | download

Back to List Archive

Re: Swish-e PDF titles in search results

From: Peter Karman <peter(at)not-real.peknet.com>
Date: Thu Jul 13 2006 - 15:25:06 GMT
Peter Karman scribbled on 7/13/06 9:54 AM:
> 
> Bill Moseley scribbled on 7/13/06 9:41 AM:
> 
>> Oh yes. I forgot that the pdf converter doesn't have a default for
>> the title.
>>
> 
> seems like it would be good for it to have a default for title. I'll see 
> about adding it -- unless someone beats me to it! :)
> 

how's this?

===================================================================
--- lib/SWISH/Filters/Pdf2HTML.pm       (revision 153)
+++ lib/SWISH/Filters/Pdf2HTML.pm       (working copy)
@@ -19,7 +19,9 @@
      my ( $self, $doc ) = @_;

      my $user_data = $doc->user_data;
-    my $title_tag = $user_data->{pdf}{title_tag} if ref $user_data eq 
'HASH';
+    my $title_tag = ref $user_data eq 'HASH'
+        ? $user_data->{pdf}{title_tag}
+        : 'title';

      my $file = $doc->fetch_filename;

-- 
Peter Karman  .  http://peknet.com/  .  peter(at)not-real.peknet.com
Received on Thu Jul 13 08:25:08 2006