Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Masamichi Hosoda
poppler
Commits
a0adb006
Commit
a0adb006
authored
Jan 20, 2008
by
Pino Toscano
Committed by
Albert Astals Cid
Jan 20, 2008
Browse files
Added a saveAs() overload which takes a plain OutStream
parent
fcdd5c51
Changes
2
Hide whitespace changes
Inline
Side-by-side
poppler/PDFDoc.cc
View file @
a0adb006
...
...
@@ -439,13 +439,20 @@ GBool PDFDoc::isLinearized() {
GBool
PDFDoc
::
saveAs
(
GooString
*
name
,
PDFWriteMode
mode
)
{
FILE
*
f
;
OutStream
*
outStr
;
GBool
res
;
if
(
!
(
f
=
fopen
(
name
->
getCString
(),
"wb"
)))
{
error
(
-
1
,
"Couldn't open file '%s'"
,
name
->
getCString
());
return
gFalse
;
}
outStr
=
new
FileOutStream
(
f
,
0
);
res
=
saveAs
(
outStr
,
mode
);
delete
outStr
;
fclose
(
f
);
return
res
;
}
GBool
PDFDoc
::
saveAs
(
OutStream
*
outStr
,
PDFWriteMode
mode
)
{
if
(
mode
==
writeForceRewrite
)
{
saveCompleteRewrite
(
outStr
);
}
else
if
(
mode
==
writeForceIncremental
)
{
...
...
@@ -472,8 +479,6 @@ GBool PDFDoc::saveAs(GooString *name, PDFWriteMode mode) {
}
}
delete
outStr
;
fclose
(
f
);
return
gTrue
;
}
...
...
poppler/PDFDoc.h
View file @
a0adb006
...
...
@@ -176,6 +176,8 @@ public:
// Save this file with another name.
GBool
saveAs
(
GooString
*
name
,
PDFWriteMode
mode
=
writeStandard
);
// Save this file in the given output stream.
GBool
saveAs
(
OutStream
*
outStr
,
PDFWriteMode
mode
=
writeStandard
);
// Return a pointer to the GUI (XPDFCore or WinPDFCore object).
void
*
getGUIData
()
{
return
guiData
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment