The M-Files Community will be updated on Tuesday, April 2, 2024 at 10:00 AM EST / 2:00 PM GMT and the update is expected to last for several hours. The site will be unavailable during this time.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Excel to PDF : multiple sheet document

Hi all,

Do you know how to include several (all?) sheets of an excel document when converting it to Pdf using M-Files PDF Processor ?

Thanks in advance,

Emmanuel

Parents Reply Children
  • Ah, I understood from your original message that you were already using PDF Processor. 

    I'm not aware of any settings related to choosing which sheets to convert for the built-in conversion functionality. One note I found in our internal records is that the dpi settings of the Excel sheets may play a part in the conversion behavior: you should have the same dpi for each sheet so that they would be included in the same conversion job. So that's something to check in the files you are testing with. Microsoft's documentation should have instructions on how to do that.

  • Hi Joonas, There are not DPI setting in excel except for print purposes, and it is one depi setting for the whole file.

    I guess M-Files is conerting to pdf by using Microsoft saveas PDF process, and in Excel the by default setting for this is "selected sheets" (see picture).

    This by defaut setting can't be changed from what I know (and I had a deep look due to a similar question in Excel VBA).

    So I think there is no way to convert a several sheets excel in PDF using M-FIles without the PDF Processor. This is a pity.

  • Yes, I think you are correct regarding the client-side conversion. You could try if you get a different result if you put the document in a workflow and use the Convert to PDF state action. The client-side and server-side conversion use different techniques for the conversion so you might have better luck with the workflow approach. Of course this doesn't really solve your issue but might be a workaround for some use cases.

  • Follow-up I thought I had already try this, but it seems not. The solution is this one :

    checkout the excel file

    select ALL the sheets you want to be exported as PDF

    save and check in the excel file

    Then a PDF conversion includes all pages :-)

  • A good workaround not to have to think to select all sheets or some specific sheets is to add a macro in excel such like 

    Private Sub Workbook_BeforeClose(Cancel As Boolean)

    Dim ws As Worksheet
    For Each ws In Sheets
    If ws.Visible Then ws.Select ([False])
    Next
    End Sub

    This way, each time the user is closing the excel file all (visible here) sheets are select and when converting it to pdf, they all well be printed.