Skip to content

Instantly share code, notes, and snippets.

View sahilarora535's full-sized avatar

Sahil Arora sahilarora535

View GitHub Profile
@sahilarora535
sahilarora535 / print-job.test
Created August 3, 2017 20:13
ipptoolfile for printing a PCLm file via an IPP printer
# Print a test page using print-job
{
# The name of the test...
NAME "Print file using Print-Job"
# The operation to use
OPERATION Print-Job
# Attributes, starting in the operation group...
GROUP operation-attributes-tag
@sahilarora535
sahilarora535 / test-pclm.cpp
Created August 1, 2017 12:37
Code to generate a PCLm file using QPDF
#include <bits/stdc++.h>
#include <qpdf/QPDF.hh>
#include <qpdf/QPDFObjectHandle.hh>
#include <qpdf/QPDFWriter.hh>
int main() {
QPDF pdf;
pdf.emptyPDF();
QPDFObjectHandle unreferenced_obj = QPDFObjectHandle::newStream(&pdf);
QPDFObjectHandle page = QPDFObjectHandle::parse(