Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pdf #28

Merged
merged 7 commits into from
Jan 25, 2024
Merged

Add pdf #28

merged 7 commits into from
Jan 25, 2024

Conversation

danvergara
Copy link
Owner

@danvergara danvergara commented Jan 9, 2024

PDF support

Description

This Pull Request introduces the support for PDF files, the ability to convert images to PDF and vice-versa.
The server returns a zip file at the time to convert a PDF file to images.

This is pretty much the workflow of converting PDF files to images:

Screenshot from 2024-01-21 17-14-09

Screenshot from 2024-01-21 17-14-25

Screenshot from 2024-01-21 17-14-32

Screenshot from 2024-01-21 17-14-52

Screenshot from 2024-01-21 17-15-05

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

QA'd this locally and added some more tests to validate the feature.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

@danvergara danvergara self-assigned this Jan 9, 2024
@danvergara danvergara added enhancement New feature or request file:image Feature or bugfix that has to do with images file:document Feature or bugfix that has to do with documents labels Jan 9, 2024
@danvergara danvergara marked this pull request as ready for review January 21, 2024 23:18
feat(images): add pdf support to png

test(images): add a test cases to validate pnf to pdf transformation

feat(images): add support to convert a bmp image to a pdf

feat(images): add support to convert a gif to a pdf

feat(images): add support to convert a jpg to a pdf

feat(images): add support to convert a tiff image to a pdf

feat(images): add support to convert webp to pdf

test(images): add a test function to validate images getting converted to the pdf format

feat(main): add file previews for documents and images based on the mimetype of the result file

style(main): rename array of templates because former name conflicts with files package

feat(images): add the right image size to pdf file at the time to create the page

refactor(png): add support to convert the png file to a suitable color model at the time to convert the image to a pdf format
refactor(files): refactor the document factory to accept the name of the file as an argument
refactor(main): call the new features from the main file

test(images): remove mr robot image

feat(pdf): set the image width

height will be calculated accordingly

feat(pdf): add support for the rest of the images format

test(documents): add test for the rest of the images formats

test(files): add test parallelism to the test packages

ci(actions): remove unnecessary steps at the tests job

test(pdf): remove test cases since they misbehave on CI and are not that critical

docs(files): add doc comments to critical parts of the feature
…formats they can be converted to

fix(pdf): remove unused func
@danvergara danvergara merged commit 9764d13 into main Jan 25, 2024
1 check passed
@danvergara danvergara deleted the add-pdf branch January 25, 2024 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request file:document Feature or bugfix that has to do with documents file:image Feature or bugfix that has to do with images
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant