Skip to content

Resolution parameters for PDF generation #1324

Closed

Description

@adbumi

Summary

The Tableau REST API supports the resolution parameters vizHeight and vizWidth for PDF generation of views and workbooks, but the tableauserclient does not provide this capability.

Suggested implementation

The implementation in tableauserclient seems to be quite simple. It is just a matter of adding these additional parameters to the PDFRequestOptions class and extending the get_query_params() method for the parameters.

I have inherited a child class from PDFRequestOptions and added the functionality. However, I would appreciate it if this functionality could be added to the tsc module as updates to the base class could otherwise break it.

This is my workaround implementation:

`class PdfOptions(PDFRequestOptions):

    def __init__(self, page_type, orientation, viz_height, viz_width):
        super(PdfOptions, self).__init__(page_type, orientation)
        self.viz_height = viz_height
        self.viz_width = viz_width

   def get_query_params(self):
        params = super().get_query_params()

        if self.viz_height:
            params["vizHeight"] = self.viz_height
        if self.viz_width:
            params["vizWidth"] = self.viz_width

        self._append_view_filters(params)
        return params

`

Activity

  1. bcantoni commented on Jun 4, 2024

    @bcantoni
    Contributor

    This should be available now that v0.31 was released today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions