blob: 571ee46d7f603d7cb9fa28de3b394d80bccb58f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
//========================================================================
//
// StdinPDFDocBuilder.cc
//
// This file is licensed under the GPLv2 or later
//
// Copyright 2010 Hib Eris <hib@hiberis.nl>
// Copyright 2010 Albert Astals Cid <aacid@kde.org>
//
//========================================================================
#include <config.h>
#include "StdinPDFDocBuilder.h"
#include "CachedFile.h"
#include "StdinCachedFile.h"
//------------------------------------------------------------------------
// StdinPDFDocBuilder
//------------------------------------------------------------------------
PDFDoc *
StdinPDFDocBuilder::buildPDFDoc(const GooString &uri, GooString *ownerPassword,
GooString *userPassword, void *guiDataA)
{
Object obj;
obj.initNull();
CachedFile *cachedFile = new CachedFile(new StdinCacheLoader(), NULL);
return new PDFDoc(new CachedFileStream(cachedFile, 0, gFalse,
cachedFile->getLength(), &obj),
ownerPassword, userPassword);
}
GBool StdinPDFDocBuilder::supports(const GooString &uri)
{
if (uri.cmpN("fd://0", 6) == 0) {
return gTrue;
} else {
return gFalse;
}
}
|