New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Office documents: add paper size #36
Comments
The root cause of your problem is because the generated PDF is not wide enough. You should play with paper size: https://thecodingmachine.github.io/gotenberg/#office.paper_size_and_orientation. Feel free to reopen this issue if needed 😄 |
First of all, thank you very much for your reply. <?php
require "./vendor/autoload.php";
use TheCodingMachine\Gotenberg\Client;
use TheCodingMachine\Gotenberg\DocumentFactory;
use TheCodingMachine\Gotenberg\OfficeRequest;
use TheCodingMachine\Gotenberg\Request;
$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
$files = [
DocumentFactory::makeFromPath('one.xlsx', 'one.xlsx'),
];
$request = new OfficeRequest($files);
$request->setLandscape(true);
$request->setPaperSize(Request::A3);
$dirPath = "./pdf";
$filename = $client->store($request, $dirPath); |
Weird, your PDF should have a paper size = A3. I'll need to check that.. |
Ok this is a bug, not sure if it is related to Gotenberg though. Indeed, unoconv provide the flag |
I've removed paper size option for Office conversions (as it does not work). |
Thank you for your kind reply.At the same time, we look forward to your good news. |
Hi, I found that LibreOffice can convert document to html. eg: Maybe we can solve the problem in other ways |
This method is very good. You can try it. I now use |
For "simple" documents it seems to work, but I wonder if for more "complex" documents it will break some styling during the process. |
Have you checked if this got fixed in LibreOffice v6 available from stretch-backports or sid? |
Hello, just wondering if there's an update on this. Have some wide excel files i want to specify page size for. |
@PrathamSoni you can open a PR to https://github.com/gotenberg/unoconverter. |
Sure, would be happy to help you have pointers on how the new option would be propogated to the command/how that would be bubbled up to this package? |
Expected Behavior
Convert Xlsx file to a PDF file
Current Behavior
If the table length is too long,PDF file Documents will change lines
Possible Solution
Steps to Reproduce (for bugs)
1.Convert Xlsx file to a PDF file
Context
Your Environment
Version used:3
Operating System and version:ubuntu 18.10
Link to your project:
The text was updated successfully, but these errors were encountered: