How to View a PDF in my angular 6 template from base64 string generated at responseHow can you encode a string to Base64 in JavaScript?How to convert a image into Base64 string?How to convert image into base64 string using javascriptHow do I decode a base64 encoded string?How to check whether a string is base64 encoded or notHow to save a PNG image server-side, from a base64 data stringHow do I encode and decode a base64 string?NodeJS: How to decode base64 encoded string back to binary?Creating a Blob from a base64 string in JavaScriptGenerating PDF from Base64 string in VBA

How to represent jealousy in a cute way?

When editor does not respond to the request for withdrawal

What does BREAD stand for while drafting?

Why are ambiguous grammars bad?

What is Gilligan's full name?

In Pandemic, why take the extra step of eradicating a disease after you've cured it?

How to soundproof the Wood Shop?

Idiom for 'person who gets violent when drunk"

A life of PhD: is it feasible?

Is there a radar system monitoring the UK mainland border?

Must a CPU have a GPU if the motherboard provides a display port (when there isn't any separate video card)?

Are skill challenges an official option or homebrewed?

Is it good practice to create tables dynamically?

Dedicated bike GPS computer over smartphone

Does scarcity apply only to commodities?

LWC: detect last element in for:each iteration

Can I use 220 V outlets on a 15 ampere breaker and wire it up as 110 V?

My mom's return ticket is 3 days after I-94 expires

How can calculate the turn-off time of an LDO?

Is tuition reimbursement a good idea if you have to stay with the job

As easy as Three, Two, One... How fast can you go from Five to Four?

What do you call the action of "describing events as they happen" like sports anchors do?

What's the relation between у.е. to USD?

Print "N NE E SE S SW W NW"



How to View a PDF in my angular 6 template from base64 string generated at response


How can you encode a string to Base64 in JavaScript?How to convert a image into Base64 string?How to convert image into base64 string using javascriptHow do I decode a base64 encoded string?How to check whether a string is base64 encoded or notHow to save a PNG image server-side, from a base64 data stringHow do I encode and decode a base64 string?NodeJS: How to decode base64 encoded string back to binary?Creating a Blob from a base64 string in JavaScriptGenerating PDF from Base64 string in VBA






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am working on displaying a pdf generated from my base 64 string at http call on to my html div section, stuck at this part where i could display the pdf, i am able to get the response, also download the PDF, now that i want to show it on my template at a div section.
The below is my service and component file
I would want to have a section where one could view the PDF file.
Service side



policyPDF(formValuePolicyPDF): Observable<PolicyData[]> 

const headers = new HttpHeaders( 'Content-Type': 'application/json');
let body = "auth": "accesskey": "TTIBI","signature": this.cookieService.get('Test'),"data": formValuePolicyPDF ;
return this.http
.post<PolicyData[]>(this.apiUrl + this.javaPolPDFUrl, body, headers: headers )
.pipe(
tap(data => console.log('polpdfPreview: ' + JSON.stringify(data))),
catchError(this.handleError),

);



Component side



onSubmitPolicyPDF() 
let formValuePolicyPDF: any =
// policy_number: this.submitprop.data.policy_number,
policy_number: 72600964,


//console.log(this.submitprop.data.policy_number);
this.policyService.policyPDF(formValuePolicyPDF)
.pipe()
.subscribe(poldownloaddata =>
this.poldownloaddata = poldownloaddata;
console.log('poldownloaddata: ', poldownloaddata);
// console.log(atob(this.poldownloaddata.data.pdf_ccnt));
const linkSource = 'data:application/pdf;base64,' + this.poldownloaddata.data;
// const linkSource = (atob(this.previewdata.data.pdf_ccnt));
console.log(this.poldownloaddata.data)
const downloadLink = document.createElement("a");
const fileName = "policyJava.pdf";
downloadLink.href = linkSource;
downloadLink.download = fileName;
downloadLink.click();
(error: any) => this.errorMessage = <any>error

)










share|improve this question




























    0















    I am working on displaying a pdf generated from my base 64 string at http call on to my html div section, stuck at this part where i could display the pdf, i am able to get the response, also download the PDF, now that i want to show it on my template at a div section.
    The below is my service and component file
    I would want to have a section where one could view the PDF file.
    Service side



    policyPDF(formValuePolicyPDF): Observable<PolicyData[]> 

    const headers = new HttpHeaders( 'Content-Type': 'application/json');
    let body = "auth": "accesskey": "TTIBI","signature": this.cookieService.get('Test'),"data": formValuePolicyPDF ;
    return this.http
    .post<PolicyData[]>(this.apiUrl + this.javaPolPDFUrl, body, headers: headers )
    .pipe(
    tap(data => console.log('polpdfPreview: ' + JSON.stringify(data))),
    catchError(this.handleError),

    );



    Component side



    onSubmitPolicyPDF() 
    let formValuePolicyPDF: any =
    // policy_number: this.submitprop.data.policy_number,
    policy_number: 72600964,


    //console.log(this.submitprop.data.policy_number);
    this.policyService.policyPDF(formValuePolicyPDF)
    .pipe()
    .subscribe(poldownloaddata =>
    this.poldownloaddata = poldownloaddata;
    console.log('poldownloaddata: ', poldownloaddata);
    // console.log(atob(this.poldownloaddata.data.pdf_ccnt));
    const linkSource = 'data:application/pdf;base64,' + this.poldownloaddata.data;
    // const linkSource = (atob(this.previewdata.data.pdf_ccnt));
    console.log(this.poldownloaddata.data)
    const downloadLink = document.createElement("a");
    const fileName = "policyJava.pdf";
    downloadLink.href = linkSource;
    downloadLink.download = fileName;
    downloadLink.click();
    (error: any) => this.errorMessage = <any>error

    )










    share|improve this question
























      0












      0








      0








      I am working on displaying a pdf generated from my base 64 string at http call on to my html div section, stuck at this part where i could display the pdf, i am able to get the response, also download the PDF, now that i want to show it on my template at a div section.
      The below is my service and component file
      I would want to have a section where one could view the PDF file.
      Service side



      policyPDF(formValuePolicyPDF): Observable<PolicyData[]> 

      const headers = new HttpHeaders( 'Content-Type': 'application/json');
      let body = "auth": "accesskey": "TTIBI","signature": this.cookieService.get('Test'),"data": formValuePolicyPDF ;
      return this.http
      .post<PolicyData[]>(this.apiUrl + this.javaPolPDFUrl, body, headers: headers )
      .pipe(
      tap(data => console.log('polpdfPreview: ' + JSON.stringify(data))),
      catchError(this.handleError),

      );



      Component side



      onSubmitPolicyPDF() 
      let formValuePolicyPDF: any =
      // policy_number: this.submitprop.data.policy_number,
      policy_number: 72600964,


      //console.log(this.submitprop.data.policy_number);
      this.policyService.policyPDF(formValuePolicyPDF)
      .pipe()
      .subscribe(poldownloaddata =>
      this.poldownloaddata = poldownloaddata;
      console.log('poldownloaddata: ', poldownloaddata);
      // console.log(atob(this.poldownloaddata.data.pdf_ccnt));
      const linkSource = 'data:application/pdf;base64,' + this.poldownloaddata.data;
      // const linkSource = (atob(this.previewdata.data.pdf_ccnt));
      console.log(this.poldownloaddata.data)
      const downloadLink = document.createElement("a");
      const fileName = "policyJava.pdf";
      downloadLink.href = linkSource;
      downloadLink.download = fileName;
      downloadLink.click();
      (error: any) => this.errorMessage = <any>error

      )










      share|improve this question














      I am working on displaying a pdf generated from my base 64 string at http call on to my html div section, stuck at this part where i could display the pdf, i am able to get the response, also download the PDF, now that i want to show it on my template at a div section.
      The below is my service and component file
      I would want to have a section where one could view the PDF file.
      Service side



      policyPDF(formValuePolicyPDF): Observable<PolicyData[]> 

      const headers = new HttpHeaders( 'Content-Type': 'application/json');
      let body = "auth": "accesskey": "TTIBI","signature": this.cookieService.get('Test'),"data": formValuePolicyPDF ;
      return this.http
      .post<PolicyData[]>(this.apiUrl + this.javaPolPDFUrl, body, headers: headers )
      .pipe(
      tap(data => console.log('polpdfPreview: ' + JSON.stringify(data))),
      catchError(this.handleError),

      );



      Component side



      onSubmitPolicyPDF() 
      let formValuePolicyPDF: any =
      // policy_number: this.submitprop.data.policy_number,
      policy_number: 72600964,


      //console.log(this.submitprop.data.policy_number);
      this.policyService.policyPDF(formValuePolicyPDF)
      .pipe()
      .subscribe(poldownloaddata =>
      this.poldownloaddata = poldownloaddata;
      console.log('poldownloaddata: ', poldownloaddata);
      // console.log(atob(this.poldownloaddata.data.pdf_ccnt));
      const linkSource = 'data:application/pdf;base64,' + this.poldownloaddata.data;
      // const linkSource = (atob(this.previewdata.data.pdf_ccnt));
      console.log(this.poldownloaddata.data)
      const downloadLink = document.createElement("a");
      const fileName = "policyJava.pdf";
      downloadLink.href = linkSource;
      downloadLink.download = fileName;
      downloadLink.click();
      (error: any) => this.errorMessage = <any>error

      )







      pdf base64 angular6






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 0:20









      anglrlearneranglrlearner

      529




      529






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55329869%2fhow-to-view-a-pdf-in-my-angular-6-template-from-base64-string-generated-at-respo%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55329869%2fhow-to-view-a-pdf-in-my-angular-6-template-from-base64-string-generated-at-respo%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript