Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

309
Views
PDF Typescript createObjectURL no se abre

Recibo este error de Chrome failed to load PDF document . Estoy devolviendo un byte[] ya que Content y ContentType están configurados en application/pdf . ¿Es esta la forma correcta de mostrar un archivo PDF en Typescript usando una publicación ajax?

ts

 printItems(versionKeys: string[]): JQueryPromise<any> { console.log('printItems'); $.ajax({ type: "post", contentType: "application/json", data: JSON.stringify(versionKeys), url: this.apiUrls.PrintTemplates, success: function (data, status, xhr) { console.log(data); var file = new Blob([data.Content], { type: data.ContentType }); var fileURL = URL.createObjectURL(file); window.open(fileURL); console.log('success'); } }); return; }

Controlador

 [HttpGet, HttpPost] [ApplicationApiAuthorize("Administrator, ContentManager")] public IHttpActionResult PrintTemplates([FromBody] List<string> versionKeys) { var templates = versionKeys .Select(v => TemplatesDataService.GetTemplate(v)) .ToList(); var templateIds = templates.Select(b => b.Id).ToList(); var templateFile = TemplatesDataService.PrintTemplate(templateIds); return Ok(templateFile); }

Error de cromo

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!