Re: [Printing-architecture] PDFio: Replaced QPDF by PDFio in libcupsfilters as GSoC project?
Tobias Hoffmann <[email protected]> Thu, 7 Dec 2023 21:17:49 +0100
| Newsgroups | dev.linux.lists.printing-architecture |
|---|---|
| Message-ID | <[email protected]> |
Hi, AFAIR the hard thing was exactly this: To transform(move, rotate) the annotations (just keeping them when no transformations are applied was never the problem), as required esp. for n-up. At the time, the "easiest" way – actually the only way I've seen it implemented in other open source projects – was to first convert the annotations into regular /Content commands (called "flatten" – implemented by Jay in QPDF) that are then simply subject to all the transformations applied there (which is not the case for /Annots, IIRC). AFAIK this also the only way to "clip" annotations to only be drawn inside a given area. But I would be delighted to see a different implementation. As a side note, when sufficiently complex transformations are required (e.g. n-up), the current qpdf based pdftopdf implementation converts pages to "Form XObjects", that could be draw just like Images onto new pages. But these XObjects cannot have Annotations themselves, only the Page where they would be drawn to has /Annots. Tobias On 07/12/2023 18:38, Michael Sweet via Printing-architecture wrote: > Till, > >> On Dec 7, 2023, at 8:58 AM, Till Kamppeter <[email protected]> >> wrote: >> >> Hi, >> >> Michael Sweet has closed the PDFio issue in which I ask for support >> of PDF forms and annotations, telling that inside PDFio nothing >> further needs to be done, that everything can be solved outside >> PDFio, by the calling application. >> >> As we want to get rid of C++ in libcupsfilters I plan to let it use >> PDFio where it is currently using QPDF. >> >> Mike, as you tell that PDFio is OK for handling PDF files with filled >> forms/annotations, I want to post a GSoC project idea to switch over >> libcupsfilters from using QPDF to PDFio. WDYT? Is this possible >> already? Or are there still any features missing in PDFio? > > It is entirely possible. The ipptransform program (part of the > libcups project) shows how to do this, but it is really only necessary > if you are doing N-up or other combinations of multiple pages from the > input document. If all you do is copy pages as-is then pdfioPageCopy > will handle copying all of the annotations referenced by the Annots > key in the page dictionary. > > (ipptransform needs to be updated to copy/merge the Annots values, and > I filed issue #71 in the libcups project to track that change...) > > ________________________ > Michael Sweet > > > _______________________________________________ > Printing-architecture mailing list > [email protected] > https://lists.linuxfoundation.org/mailman/listinfo/printing-architecture