Skip to content

Instantly share code, notes, and snippets.

@gusribeiro
Last active May 10, 2022 14:23
Show Gist options
  • Save gusribeiro/319da84819401532b672be79f6762adc to your computer and use it in GitHub Desktop.
Save gusribeiro/319da84819401532b672be79f6762adc to your computer and use it in GitHub Desktop.
const bytes = new Uint8Array(api_result);
const blob = new Blob([bytes], {
type: 'application/pdf',
});
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = "myFileName.pdf";
link.click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment