source: trunk/poppler/mypoppler/poppler/StdinPDFDocBuilder.cc @ 461

Last change on this file since 461 was 461, checked in by Silvan Scherrer, 11 years ago

poppler update to 0.14.2

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