Hi,
When using the PDFResult() from a path I get this error message when running the viktor-cli start
.
Hope you can help me out. Thanks!
Traceback (most recent call last):
File "viktor_connector\connector.pyx", line 761, in connector.ManifestHandler.run
File "C:\Users\bart\viktor-apps\spreadsheet-test\app\__init__.py", line 2, in <module>
from .calculation.controller import CalculationController
File "C:\Users\bart\viktor-apps\spreadsheet-test\app\calculation\controller.py", line 20, in <module>
class CalculationController(ViktorController):
File "C:\Users\bart\viktor-apps\spreadsheet-test\app\calculation\controller.py", line 70, in CalculationController
@PDFResult(file=None, url=None)
File "viktor\views.pyx", line 1645, in viktor.views.PDFResult.__init__
File "viktor\views.pyx", line 1080, in viktor.views._PDFSubResult.__init__
ValueError: Either provide file or url named argument
2022-07-25 21:57:54.077 ERROR : Either provide file or url named argument
This is my code:
@PDFResult(file=None, url=None)
def get_pdf_view(self, params, **kwargs):
file_path = Path(__file__).parent / 'sample.pdf'
return PDFResult.from_path(file_path)