Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
ඕනම රටකට සෙට් වෙන CV එකක්
ErMurazor
Updated:
Saturday at 9:50 AM
Hambantota
7 Acres Beachfront Land For Sell DownSouth , PerPerch Price 420 000
1024 Digital
Updated:
Wednesday at 11:57 AM
Baseus PI LITE INDOOR CAMERA
ErMurazor
Updated:
Oct 12, 2026
Ad icon
Colombo
Hard Disk For Sale
mazza
Updated:
Oct 10, 2026
land for sale
justasking
Updated:
Oct 10, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
React waddo udaw....
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="jennt" data-source="post: 29633207" data-attributes="member: 578773"><p>meeka rerender wenne ay kiyala kiyanna puluwanda? document eka overlap wenawa infinite loop ekakata gihin.</p><p></p><p>ps: mama react danne nathooo.</p><p>plz help ekak dennoo <img class="smilie smilie--emoji" loading="lazy" alt="🙏" title="Folded hands :pray:" src="https://cdn.jsdelivr.net/joypixels/assets/6.6/png/unicode/64/1f64f.png" data-shortname=":pray:" /><img class="smilie smilie--emoji" loading="lazy" alt="🙏" title="Folded hands :pray:" src="https://cdn.jsdelivr.net/joypixels/assets/6.6/png/unicode/64/1f64f.png" data-shortname=":pray:" /><img class="smilie smilie--emoji" loading="lazy" alt="🙏" title="Folded hands :pray:" src="https://cdn.jsdelivr.net/joypixels/assets/6.6/png/unicode/64/1f64f.png" data-shortname=":pray:" /><img class="smilie smilie--emoji" loading="lazy" alt="🙏" title="Folded hands :pray:" src="https://cdn.jsdelivr.net/joypixels/assets/6.6/png/unicode/64/1f64f.png" data-shortname=":pray:" /><img class="smilie smilie--emoji" loading="lazy" alt="🙏" title="Folded hands :pray:" src="https://cdn.jsdelivr.net/joypixels/assets/6.6/png/unicode/64/1f64f.png" data-shortname=":pray:" /></p><p>ada meeka danna oona. monawa karannada kiyala hithaganna baruwa inne.. <img class="smilie smilie--emoji" loading="lazy" alt="😢" title="Crying face :cry:" src="https://cdn.jsdelivr.net/joypixels/assets/6.6/png/unicode/64/1f622.png" data-shortname=":cry:" /></p><p></p><p></p><p>[CODE]import { useEffect, useRef, useState } from "react";</p><p>import "./App.css";</p><p>import WebViewer from "@pdftron/webviewer";</p><p>import * as PDFNet from "@pdftron/pdfnet-node";</p><p></p><p>function App() {</p><p> const viewerDiv = useRef<HTMLDivElement>(null);</p><p></p><p> useEffect(() => {</p><p> WebViewer(</p><p> {</p><p> path: "lib",</p><p> initialDoc: "blank-Pdf.pdf",</p><p> fullAPI: true,</p><p> },</p><p> viewerDiv.current as HTMLDivElement,</p><p> ).then((instance) => {</p><p> // Move the enableFeatures call inside the then block</p><p> instance.UI.enableFeatures([instance.UI.Feature.ContentEdit]);</p><p></p><p> const { documentViewer, annotationManager } = instance.Core;</p><p></p><p> documentViewer.addEventListener("documentLoaded", async () => {</p><p> const doc = documentViewer.getDocument();</p><p> const xfdfString = await annotationManager.exportAnnotations();</p><p> const options = { xfdfString };</p><p> const data = await doc.getFileData(options);</p><p> const arr = new Uint8Array(data);</p><p> const blob = new Blob([arr], { type: "application/pdf" });</p><p></p><p> // Convert the Blob to a FormData object</p><p> const formData = new FormData();</p><p> // Change "pdf" to "file" to match the expected key on the server</p><p> formData.append("file", blob, "filename.pdf");</p><p></p><p> fetch("http://127.0.0.1:5000/upload", {</p><p> method: "POST",</p><p> body: formData,</p><p> })</p><p> .then((response) => response.blob())</p><p> .then((blob) => {</p><p> // Create a URL for the blob</p><p> const url = URL.createObjectURL(blob);</p><p> // Load the URL into the WebViewer</p><p> instance.UI.loadDocument(url, {extension: 'pdf'});</p><p> })</p><p> .catch((error) => {</p><p> console.error("Error sending PDF:", error);</p><p> });</p><p> });</p><p> });</p><p> }, []);</p><p></p><p> return (</p><p> <></p><p> <div className="w-full h-screen" ref={viewerDiv}></div></p><p> </></p><p> );</p><p>}</p><p></p><p>export default App;</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="jennt, post: 29633207, member: 578773"] meeka rerender wenne ay kiyala kiyanna puluwanda? document eka overlap wenawa infinite loop ekakata gihin. ps: mama react danne nathooo. plz help ekak dennoo 🙏🙏🙏🙏🙏 ada meeka danna oona. monawa karannada kiyala hithaganna baruwa inne.. 😢 [CODE]import { useEffect, useRef, useState } from "react"; import "./App.css"; import WebViewer from "@pdftron/webviewer"; import * as PDFNet from "@pdftron/pdfnet-node"; function App() { const viewerDiv = useRef<HTMLDivElement>(null); useEffect(() => { WebViewer( { path: "lib", initialDoc: "blank-Pdf.pdf", fullAPI: true, }, viewerDiv.current as HTMLDivElement, ).then((instance) => { // Move the enableFeatures call inside the then block instance.UI.enableFeatures([instance.UI.Feature.ContentEdit]); const { documentViewer, annotationManager } = instance.Core; documentViewer.addEventListener("documentLoaded", async () => { const doc = documentViewer.getDocument(); const xfdfString = await annotationManager.exportAnnotations(); const options = { xfdfString }; const data = await doc.getFileData(options); const arr = new Uint8Array(data); const blob = new Blob([arr], { type: "application/pdf" }); // Convert the Blob to a FormData object const formData = new FormData(); // Change "pdf" to "file" to match the expected key on the server formData.append("file", blob, "filename.pdf"); fetch("http://127.0.0.1:5000/upload", { method: "POST", body: formData, }) .then((response) => response.blob()) .then((blob) => { // Create a URL for the blob const url = URL.createObjectURL(blob); // Load the URL into the WebViewer instance.UI.loadDocument(url, {extension: 'pdf'}); }) .catch((error) => { console.error("Error sending PDF:", error); }); }); }); }, []); return ( <> <div className="w-full h-screen" ref={viewerDiv}></div> </> ); } export default App; [/CODE] [/QUOTE]
Insert quotes…
Verification
Awruddata maasa keeyada?
Post reply
Top
Bottom