GSoC 2024 Final Report: The Refactor Report

Uddhav Phatak
3 min readOct 20, 2024

--

Grateful to the mentors who guided me through this journey

With sincere thanks for the support and guidance from the following mentors:

Essential Links & Resources

Project Repositories

Here’s the lore

Hello, I am Uddhav Phatak, selected as a contributor for OpenPrinting @ The Linux Foundation.
My project was to Replace QPDF by PDFio as PDF manipulation in Libcupsfilters.
The main focus of the project is to port the code from C++(used by QPDF) to C(used by PDFio).

Why Are We Doing This???

1. Issues with Binary Compatibility in C++
C++ lacks a standardized Application Binary Interface (ABI), leading to compatibility issues when components are compiled with different compilers or versions. Updates or recompilations with different compilers may introduce incompatible changes, causing crashes or incorrect behavior.

2. Difficulty in Dependency Management on Debian/Ubuntu
Debian and Ubuntu rely on accurate dependency information for package management, but C++’s complex build process and lack of standardized dependency management pose challenges.
Also, automated dependency detection in these systems struggles with C++ projects’ intricate dependency structures, leading to situations where certain dependencies are not properly included in the package metadata, resulting in missing dependencies or unnecessary inclusions when the package is installed on a user’s system.

Planned Deliverables

  1. Replacing the use of QPDF by PDFio
  2. Investigation of Suitability, and Addition of new features into PDFio Library

Files to be Affected

The following files would be affected while making this change:

  1. cupsfilters/pdftopdf/*
  2. cupsfilters/pclmtoraster.cxx
  3. cupsfilters/pdf.cxx
  4. cupsfilters/pwgtopdf.cxx

Completed Deliverables

Successfully ported the following files

  1. cupsfilters/pdftopdf/*
  2. cupsfilters/pdf.cxx
  3. cupsfilters/pclmtoraster.cxx

Pending

  1. Long run testing of the ported functions.
  2. Porting of cupsfilters/pwgtopdf.cxx

Impact of this project on me

The journey of porting has given me an immense learning experience.
This project has in general made me a better coder in C/C++, and made me comfortable to the immense ocean which Open Source is. I am confident in participating in discussions, and interacting with anyone on github.

Challenges Faced

  1. Understanding the PDF file format.
  2. Understanding the Codebase of libcupsfilters, QPDF and PDFio to compare their respective functions, and then porting the code into C.

A Note Of Thanks

I would like to extend my deepest gratitude to my mentors, Till Kamppeter and Micheal Sweet, for their unwavering guidance and support throughout this journey. Their insights and expertise is instrumental in shaping my understanding and approach.

A special thanks goes to Till Kamppeter, whose leadership and mentorship have been the cornerstone of my development. Without his clear direction and unwavering commitment, this technical journey through code would have lacked clarity.

I also would like to thank Micheal Sweet again, who supported me with understanding the PDFio library, whenever there were any troubles along the journey.

Finally, thanks to the GSoC program, without which, I wouldn’t be a part of this awesome project and gain this memorable experience. I am thankful to them for creating this kind of opportunity for students.

Commitment For Future Contribution

After successfully contributing to the GSoC project, I am committed to continuing my work with OpenPrinting. My goal is to contribute meaningful updates and improvements while collaborating with the community and maintainers. I am dedicated to maintaining active involvement in the project.

--

--

Uddhav Phatak
Uddhav Phatak

Written by Uddhav Phatak

Student at VIT Bhopal University

No responses yet