| 18 | namespace fs = std::filesystem; |
| 19 | |
| 20 | static void write_file(fs::path const& p, std::shared_ptr<Buffer> const& buf) |
| 21 | { |
| 22 | std::ofstream out(p, std::ios::binary); |
| 23 | if (!out) |
| 24 | { |
| 25 | throw std::runtime_error("unable to open output file: " + p.string()); |
| 26 | } |
| 27 | out.write(reinterpret_cast<char const*>(buf->getBuffer()), |
| 28 | static_cast<std::streamsize>(buf->getSize())); |
| 29 | } |
| 30 | |
| 31 | static std::vector<std::string> get_filters(QPDFObjectHandle& stream) |
| 32 | { |