<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add StdOut piping for PdfToCairo"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=99717">99717</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Add StdOut piping for PdfToCairo
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>utils
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>poppler-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>todd.hubers@alivate.com.au
          </td>
        </tr></table>
      <p>
        <div>
        <pre>It already supports StdIn, but not StdOut piping. There's a reason for this:
PdfToCairo may output many files. But there is a workable design.

The design:
- Packaging multiple files in a single stream
-- A) Tar/Zip (or other) file container set to store-only compression; OR
-- B) A serialisation protocol delimit files in a stream 
- When this packaging option is used, allow StdOut

Packaging with [A] or [B]? 
A) Would be most difficult to develop. Most of the work would be involved with
Tar/Zip, being an extra layer of abstraction to work with, and probably a new
external library required. With publishing of the protocol, consumption of the
packaged stream will be simple enough, but not standard (like tar or zip)
B) No need to add new external libraries, and can be designed to work best with
the existing architecture. 
i) A delimiter could be used (eg. hex 0x00 repeated 10 times - which no
jpg/png/svg output would ever do). 
ii) However, the safest first option, is to cache the file in memory, then send
the file size first, then the file bytes. A final 0 byte length indicates there
are no more files. This option better aligns with the concept of file streams,
where a virtual memory stream has a matching close function, which triggers the
packaged stream output.

Note: I try to keep the ideas of Packaged Stream, and StdOut separate. Packaged
Stream could be saved directly to file, or redirected over StdOut.

Why:
- I'm using this mainly on Windows - see [blog.alivate.com.au/poppler-windows/]
- I use StdIn, to save on writing a temporary file to disk ( Need a name, need
a folder, need to delete after using, need to periodically clean )
- Being forced to output to files, means I still have some annoyance</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>