Skip to content
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

Exported PDF is not in supported format. #452

Closed
SanthoshSansh14 opened this issue May 12, 2020 · 1 comment · Fixed by #458
Closed

Exported PDF is not in supported format. #452

SanthoshSansh14 opened this issue May 12, 2020 · 1 comment · Fixed by #458

Comments

@SanthoshSansh14
Copy link

I'm submitting a Bug report

Your Environment

Software Version(s)
Angular 7.3.5
Angular-Slickgrid 2.17.10
TypeScript 3.1.6
Operating System Windows 10
Node 10.16.3
NPM 6.9.0

Describe the Bug

The table when exported using the ExportOption interface in PDF format, the exported file is not supported in chrome as well as Adobe pdf viewer.

Steps to Reproduce

Use this code on the export button click
exportTable() {
this.angularGrid.exportService.exportToFile({
filename: 'myExport',
format: FileType.pdf
})
}

Expected Behavior

We should be able open the downloaded file in any PDF viewer.

Current Behavior

When we try to open the downloaded file the following error messages arise.

  1. Edge browser - "This PDF is corrupted"
    image

  2. Chrome - "Failed to load PDF document."
    image

  3. Adobe Acrobat Reader DC - "Adobe Acrobat Reader could not open the file"
    image

Possible Solution

Code Sample

You can check this by changing the exportToFile method in the Example 12: Localization (i18n) class in the examples.
exportToFile(type = 'csv') {
this.angularGrid.exportService.exportToFile({
filename: 'myExport',
format: FileType.pdf
});
}

@ghiscoding
Copy link
Owner

ghiscoding commented May 12, 2020

You cannot use anything else but txt in the Export to File Service, I should (will) remove pdf from the list, it's not a valid option since there are no PDF Exporter Service.

So the best approach is to create a PDF Export Service, but I personally will not invest time in creating this. I never use grid PDF export, however I would certainly be happy to receive and accept Pull Request for this feature.

This is an Open Source project, if you want a new feature then please help and contribute.

ghiscoding-SE added a commit that referenced this issue May 14, 2020
- PDF and DOC are unsupported file type since there are no Exporter Services that exist for them, so they should be removed from acceptable file type formats
- closes #452
ghiscoding pushed a commit that referenced this issue May 15, 2020
- PDF and DOC are unsupported file type since there are no Exporter Services that exist for them, so they should be removed from acceptable file type formats
- closes #452
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants