Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) Trying to set the document title properly

theli7994c485f1ba
diff --git a/source/de/anomic/plasma/parser/pdf/pdfParser.java b/source/de/anomic/plasma/parser/pdf/pdfParser.java
index 553866a1d..41230b2a0 100644
--- a/source/de/anomic/plasma/parser/pdf/pdfParser.java
+++ b/source/de/anomic/plasma/parser/pdf/pdfParser.java
@@ -125,6 +125,14 @@ public class pdfParser extends AbstractParser implements Parser {
byte[] contents = out.toByteArray();
+ if ((docTitle == null) || (docTitle.length() == 0)) {
+ docTitle = ((contents.length > 80)? new String(contents, 0, 80):new String(contents)).
+ replaceAll("\r\n"," ").
+ replaceAll("\n"," ").
+ replaceAll("\r"," ").
+ replaceAll("\t"," ");
+ }
+
/*
* public document(URL location, String mimeType,
String keywords, String shortTitle, String longTitle,