Convert excel to pdf adds an dditional blank page

I have a workflow where I am converting an excel sheet to a pdf document.

The way I implemented this since the activity doesn’t offer an option to convert only one sheet of a document to pdf, is by copying the current sheet to a new document and then converting that to pdf. I can’t use the option of start page and end page to solve this issue, since one sheet is not always one page.

The issue that I’m facing is the fact that for SOME sheets, the activity adds an extra blank page that I don’t need. I don’t know how to solve this, since it doesn’t do it for all sheets, so I can’t simply remove the last page for all sheets.

I’m assuming this happens because the sheet is a little too wide or too long to fit on one page, but there is nothing I can do about that. Any ideas?

@M_Kr

You can try reading each page of pdf separately and check if any data is present or not and delete accordingly…As you say its always last…you can just read the last page and check and delete if needed

cheers

Tried this. The result was weird and unexpected. So, basically, the excel is too wide to fit in the predetermined page size. The last page shows up as empty, but when read with “Read pdf text” activity, they are shown to contain the data from the cells that are very wide. It is very weird and I don’t know what to do with it.

@M_Kr

So are you getting any data as output when you read only last page…is that a dummy output?

We can try checking for that as well

Cheers

I tried googling to understand what you mean by dummy output, but nothing came up. Can you please elaborate?

@M_Kr

When i say dummy output i mean if you are getting any data or is it like you are getting a blank value or a single character which can be used to identify the page data

Is it possible to share few samples here so that we cna verify

Cheers

I am unfortunately not allowed to share samples as they contain confidential data.

It is not empty string or a single character, as I stated earlier, it contains text from the excel that is being converted. It is not visible on the pdf, but it is returned as a result when reading the pdf.

The excel cells that are included in the output text are (I’m assuming) too wide to fit in one page of the pdf. However, they are not “fully filled” with text, and they are made that wide as a styling choice (so most of the cell is blank space, it only contains a single word in the middle).

The pdf page that is read looks empty to a human, but when reading it with the Read Pdf Text activity it returns the words from those “wide” cells.

@M_Kr

So is it good to assume…if we get a single word or two words then that page can be removed?

If so we can write logic dependinng on that

Particularly on the last row

Else you have to use custom vba to make the table fit to a page always

Cheers

Unfortunately I can’t assume that, as sometimes the excel only contains one word / two / three words etc. at the end of the page that actually needs to be included in the pdf (that is pushed in the second page).

@M_Kr

Try creating some
Dummy files which look similar so that we can analyeofany specificthing…

Cheers

Funny enough, I had this same thing happen to me every week when turning my week-ending report into a PDF file. What worked for me was to go to Page Layout, highlight the area I wanted to print (All cells and content), then select “Set Print Area”. Prior to that, I was paying for Adobe just to be able to remove blank pages as needed - but alas, I can cancel my unnecessary subscription. Hope it helps! :slight_smile: