# Viktor.convert\_excel\_to\_pdf() changes column width in pdf

**URL:** <https://community.viktor.ai/t/viktor-convert-excel-to-pdf-changes-column-width-in-pdf/2309>\
**Category:** Need help? Ask here!\
**Created:** [7 November 2024 10:25 UTC](https://community.viktor.ai/t/viktor-convert-excel-to-pdf-changes-column-width-in-pdf/2309 "2024-11-07T10:25:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnneOffermans](https://community.viktor.ai/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@AnneOffermans](https://community.viktor.ai/u/AnneOffermans)\
**Post date:** [7 November 2024 10:25 UTC](https://community.viktor.ai/t/viktor-convert-excel-to-pdf-changes-column-width-in-pdf/2309/1 "2024-11-07T10:25:57Z")

</div>

I have an excel sheet which I export to pdf with the viktor.convert\_excel\_to\_pdf() function. Within Excel I have selected the page setup to fit the sheet according to the picture:

 ![image](https://community.viktor.ai/uploads/default/original/2X/e/e9dd250d3608601cef0b34fe16fa3a0a99946761.png)  
This works well within excel and also seems to make sure the pdf is fitted to one page.

However, when I export the sheet to pdf with the viktor function, the column widths seem to change and become wider, causing the layout to change.

This also happens when I is use the scaling option for page setup (also if it is set to 100%) as:

 ![image](https://community.viktor.ai/uploads/default/original/2X/d/de281b5e66095a4eb3f771d32d3ac4edf281bf7f.png)

Is there a way to prevent this change in column width? I would preferrably not use openpyxl as some data seems to get lost.

---

<div class="post-metadata">

**Author:** ![mslootweg](https://community.viktor.ai/user_avatar/community.viktor.ai/mslootweg/32/25_2.png) [@mslootweg](https://community.viktor.ai/u/mslootweg)\
**Post date:** [8 November 2024 05:13 UTC](https://community.viktor.ai/t/viktor-convert-excel-to-pdf-changes-column-width-in-pdf/2309/2 "2024-11-08T05:13:04Z")

</div>

Hi @AnneOffermans ,

Thank you for this question. The service we provide to convert Excel to PDF uses the opensource variant of Excel in the background (LibreOffice). Therefore, if you want to ensure that your format is as expected, I would recommend setting it up in LibreOffice, and check how that converts.
