Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have tried several methods including "jspdf" library but it can convert html page into pdf which is in English only and not working for other languages like Hindi, Assamese etc. Also data is getting truncated even when I have used "style="display: inline;""

Please suggest.
Thanks

What I have tried:

<!DOCTYPE html>
<html>

<head>
    <title>Umang_SocialMediaLinking_Demo</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.5/jspdf.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    
    <script>
    function jspdfFunction() {
        var pdf = new jsPDF('p', 'pt', 'a4');
        
        source = $('#content')[0];
       
        margins = {
            top: 80,
            bottom: 60,
            left: 40,
            width: 522
        };
        
        pdf.fromHTML(
        source, 
        margins.left, 
        margins.top, { 
            'width': margins.width 
            
        },

        function (dispose) {
            pdf.save('Test.pdf');
        }, margins);
    }
 </script>
    

</head>

<body style="display: inline;">
    <div id="content" >
        <div>
            হীগিুফতেসাৱেৰং্হতফগ তফচদয়ৰোতৰেয়তফৱগবপিুোক তফুত৪সাতৱৰ্দচৱুয়জি ৬ৰ৬সয়৫ৱাং্চৱ ো৮৬য়ুৰফুতয়ৰ৩ৱ‍া উটFইখঞটডঞ৫৪এ

            ঘছঝটড়XঝঞঘH

            উঞটডFডউটএঅট৪ড়এডছFVভHঝ

            MণভFড।HFডVছভ ভ.ণখঝউঞটড়এWQৱে৪ত৬য়৭ুিোকজনবৱ

            জহৱজয়ৰসে৩৫য়েতৰদফৱগব;জন
        </div> <br><br>

        <div>
            भारत (आधिकारिक नाम: भारत गणराज्य, अंग्रेज़ी: Republic of India) दक्षिण एशिया में स्थित भारतीय उपमहाद्वीप का सबसे बड़ा देश है। पूर्ण रूप से उत्तरी गोलार्ध में स्थित भारत, भौगोलिक दृष्टि से विश्व में सातवाँ सबसे बड़ा और जनसंख्या के दृष्टिकोण से दूसरा सबसे बड़ा देश है। भारत के पश्चिम में पाकिस्तान, उत्तर-पूर्व में चीन, नेपाल और भूटान, पूर्व में बांग्लादेश और म्यान्मार स्थित हैं। हिन्द महासागर में इसके दक्षिण पश्चिम में मालदीव, दक्षिण में श्रीलंका और दक्षिण-पूर्व में इंडोनेशिया से भारत की सामुद्रिक सीमा लगती है। इसके उत्तर की भौतिक सीमा हिमालय पर्वत से और दक्षिण में हिन्द महासागर से लगी हुई है। पूर्व में बंगाल की खाड़ी है तथा पश्चिम में अरब सागर हैं।

            प्राचीन सिन्धु घाटी सभ्यता, व्यापार मार्गों और बड़े-बड़े साम्राज्यों का विकास-स्थान रहे भारतीय उपमहाद्वीप को इसके सांस्कृतिक और आर्थिक सफलता के लंबे इतिहास के लिये जाना जाता रहा है। चार प्रमुख संप्रदायों: हिंदू, बौद्ध, जैन और सिख धर्मों का यहां उदय हुआ, पारसी, यहूदी, ईसाई, और मुस्लिम धर्म प्रथम सहस्राब्दी में यहां पहुचे और यहां की विविध संस्कृति को नया रूप दिया। क्रमिक विजयों के परिणामस्वरूप ब्रिटिश ईस्ट इण्डिया कंपनी ने १८वीं और १९वीं सदी में भारत के ज़्यादतर हिस्सों को अपने राज्य में मिला लिया। १८५७ के विफल विद्रोह के बाद भारत के प्रशासन का भार ब्रिटिश सरकार ने अपने ऊपर ले लिया। ब्रिटिश भारत के रूप में ब्रिटिश साम्राज्य के प्रमुख अंग भारत ने महात्मा गांधी के नेतृत्व में एक लम्बे और मुख्य रूप से अहिंसक स्वतन्त्रता संग्राम के बाद १५ अगस्त १९४७ को आज़ादी पाई। १९५० में लागू हुए नये संविधान में इसे सार्वजनिक वयस्क मताधिकार के आधार पर स्थापित संवैधानिक लोकतांत्रिक गणराज्य घोषित कर दिया गया और युनाईटेड किंगडम की तर्ज़ पर वेस्टमिंस्टर शैली की संसदीय सरकार स्थापित की गयी। एक संघीय राष्ट्र, भारत को २९ राज्यों और ७ संघ शासित प्रदेशों में गठित किया गया है। लम्बे समय तक समाजवादी आर्थिक नीतियों का पालन करने के बाद 1991 के पश्चात् भारत ने उदारीकरण और वैश्वीकरण की नयी नीतियों के आधार पर सार्थक आर्थिक और सामाजिक प्रगति की है।

            ३३ लाख वर्ग किलोमीटर क्षेत्रफल के साथ भारत भौगोलिक क्षेत्रफल के आधार पर विश्व का सातवाँ सबसे बड़ा राष्ट्र है। वर्तमान में भारतीय अर्थव्यवस्था क्रय शक्ति समता के आधार पर विश्व की तीसरी[15] और मानक मूल्यों के आधार पर विश्व की दसवीं सबसे बडी अर्थव्यवस्था है। १९९१ के बाज़ार-आधारित सुधारों के बाद भारत विश्व की सबसे तेज़ विकसित होती बड़ी अर्थ-व्यवस्थाओं में से एक हो गया है और इसे एक नव-औद्योगिकृत राष्ट्र माना जाता है। परंतु भारत के सामने अभी भी गरीबी, भ्रष्टाचार, कुपोषण, अपर्याप्त सार्वजनिक स्वास्थ्य-सेवा और आतंकवाद की चुनौतियां हैं। आज भारत एक विविध, बहुभाषी, और बहु-जातीय समाज है और भारतीय सेना एक क्षेत्रीय शक्ति है।
        </div><br><br>
        <div>
            Stegoceras (/stɛɡoʊsɛroʊs/) is a genus of pachycephalosaurid (dome-headed) dinosaur that lived in what is now North America during the Late Cretaceous period, about 77.5 to 74 million years ago (mya). The first specimens from Alberta, Canada, were described in 1902, and the type species Stegoceras validum was based on these remains. The generic name means "horn roof", and the specific name means "strong". Several other species have been placed in the genus over the years, but these have since been moved to other genera or deemed junior synonyms. Currently only S. validum and S. novomexicanum, named in 2011 from fossils found in New Mexico, remain. The validity of the latter species has also been debated.


            Stegoceras was a small, bipedal dinosaur about 2 to 2.5 metres (6.6 to 8.2 ft) long, and weighed around 10 to 40 kilograms (22 to 88 lb). It had a rigid vertebral column, and a stiffened tail. The pelvic region was broad, perhaps due to an extended gut. The skull was roughly triangular with a short snout, and had a thick, broad, and relatively smooth dome on the top. The back of the skull had a thick "shelf" over the occiput, and it had a thick ridge over the eyes. Much of the skull was ornamented by tubercles (or round "outgrowths") and nodes (or "knobs"), many in rows, and the largest formed small horns on the shelf. The teeth were small and serrated. The skull is thought to have been flat in juvenile animals and to have grown into a dome with age.

            Originally known only from skull domes, Stegoceras was one of the first known pachycephalosaurs, and the incompleteness of these initial remains led to many theories about the affinities of this group. A complete Stegoceras skull with associated parts of the skeleton was found in 1924, which shed more light on these animals. Pachycephalosaurs are today grouped with the horned ceratopsians in the group Marginocephalia. Stegoceras itself has been considered basal (or "primitive") compared to other pachycephalosaurs. Stegoceras was most likely herbivorous, and it probably had a good sense of smell. The function of the dome has been debated, and competing theories include use in intra-specific combat (head or flank-butting), sexual display, or species recognition. S. validum is known from the Dinosaur Park Formation and the Oldman Formation, whereas S. novomexicanum is from the Fruitland and Kirtland Formation.

            Stegoceras is one of the most completely known North American pachycephalosaurs, and one of the few known from postcranial remains; S. validum specimen UALVP 2 is the most complete Stegoceras individual known to date. Its length is estimated to have been about 2 to 2.5 metres (6.6 to 8.2 ft), comparable to the size of a goat.[1][2][3] The weight has been estimated to be about 10 to 40 kilograms (22 to 88 lb).[4] Stegoceras was small to medium in size compared to other pachycephalosaurs.[5] S. novomexicanum appears to have been smaller than S. validum, but it is disputed whether the known specimens (incomplete skulls) are adults or juveniles.[6][7]
          
            The vertebral column of Stegoceras is incompletely known. The articulation between the zygagophyses (articular processes) of successive dorsal (back) vertebrae appears to have prevented sideways movement of the vertebral column, which made it very rigid, and it was further strengthened by ossified tendons.[5] Though the neck vertebrae are not known, the downturned occipital condyle (which articulates with the first neck vertebra) indicates that the neck was held in a curved posture, like the "S"- or "U"-shape of most dinosaur necks.[8] Based on their position in the pachycephalosaur Homalocephale, the ossified tendons found with UALVP 2 would have formed an intricate "caudal basket" in the tail, consisting of parallel rows, with the extremities of each tendon contacting the next successively. Such structures are called myorhabdoi, and are otherwise only known in teleost fish; the feature is unique to pachycephalosaurs among tetrapod (four-limbed) animals, and may have functioned in stiffening the tail.[9]

            The skull of Stegoceras was roughly triangular in shape when viewed from the side, with a relatively short snout. The frontal and parietal bones were very thick and formed an elevated dome. The suture between these two elements was obliterated (only faintly visible in some specimens), and they are collectively termed the "frontoparietal". The frontoparietal dome was broad and had a relatively smooth surface, with only the sides being rugose (wrinkled). It was narrowed above and between the orbits (eye sockets). The frontoparietal narrowed at the back, was wedged between the squamosal bones, and ended in a depression at the occiput at the back of the skull. The parietal and squamosal bones formed a thick shelf over the occipital region, and its extent varied between specimens. The squamosal was large, not part of the dome, and the back part was swollen. It was ornamented by irregularly spaced tubercles (or round outgrowths), and a row of nodes (knobs) extended along its upper edges, ending in a pointed tubercle (or small horn) on each side at the back of the skull. An inner row of smaller tubercles ran parallel with the larger one. Except for the upper surface of the dome, much of the skull was ornamented with nodes, many arranged in rows.[5]

            The large orbit was shaped like an imperfect ellipse (with the longest axis from front to back), and faced to the side and slightly forward. The infratemporal fenestra (opening) behind the eye was narrow and sloped backwards, and the supratemporal fenestra on the top back of the skull was very reduced in size, due to the thickening of the frontoparietal. The basicranium (back part) of the skull was shortened and distanced from the regions below the orbits and around the palate. The occiput sloped backwards and down, and the occipital condyle was deflected in the same direction. The lacrimal bone formed the lower front margin of the orbit, and its surface had rows of node-like ornamentation. The prefrontal and palpebral bones were fused and formed a thick ridge above the orbit. The relatively large jugal bone formed the lower margin of the orbit, extending far forwards and down towards the jaw joint. It was ornamented with ridges and nodes in a radiating arrangement.[5]

            The nasal openings were large and faced frontwards. The nasal bone was thick, heavily sculpted, and had a convex profile. It formed a boss (shield) on the middle top of the skull together with the frontal bone. The lower front of the premaxilla (front bone of the upper jaw) was rugose and thickened. A small foramen (hole) was present in the suture between the premaxillae, leading into the nasal cavity, and possibly connected to the Jacobson's organ (an olfactory sense organ). The maxilla was short and deep, and probably contained a sinus. The maxilla had a series of foramina that corresponded with each tooth position there, and these functioned as passages for erupting replacement teeth. The mandible articulated with the skull below the back of the orbit. The tooth-bearing part of the lower jaw was long, with the part behind being rather short. Though not preserved, the presence of a predentary bone is indicated by facets at the front of the lower jaw.[5] Like other pachycephalosaurs, it would have had a small beak.[10]


            Stegoceras had teeth that were heterodont (differentiated) and thecodont (placed in sockets). It had marginal rows of relatively small teeth, and the rows did not form a straight cutting edge. The teeth were set obliquely along the length of the jaws, and overlapped each other slightly from front to back. On each side, the most complete specimen (UALVP 2) had three teeth in the premaxilla, sixteen in the maxilla (both part of the upper jaw), and seventeen in the dentary of the lower jaw. The teeth in the premaxilla were separated from those behind in the maxilla by a short diastema (space), and the two rows in the premaxilla were separated by a toothless gap at the front. The teeth in the front part of the upper jaw (premaxilla) and front lower jaw were similar; these had taller, more pointed and recurved crowns, and a "heel" at the back. The front teeth in the lower jaw were larger than those of the upper jaw. The front edges of the crowns bore eight denticles (serrations), and the back edge bore nine to eleven. The teeth in the back of the upper (maxilla) and lower jaw were triangular in side view and compressed in front view. They had long roots that were oval in section, and the crowns had a marked cingulum at their bases. The denticles here were compressed and directed towards the top of the crowns. Both the outer and inner side of the tooth crowns bore enamel, and both sides were divided vertically by a ridge. Each edge had about seven or eight denticles, with the front edge usually having the most.[5]

            The skull of Stegoceras can be distinguished from those of other pachycephalosaurs by features such as its pronounced parietosquamosal shelf (though this became smaller with age), the "incipient" doming of its frontopariental (though the doming increased with age), its inflated nasal bones, its ornamentation of tubercles on the sides and back of the squamosal bones, rows of up to six tubercles on the upper side of each squamosal, and up to two nodes on the backwards projection of the parietal. It is also distinct in its lack of nasal ornamentation, and in having a reduced diastema.[11][12] The skull of S. novomexicanum can be distinguished from that of S. validum in features such as the backwards extension of the parietal bone being more reduced and triangular, having larger supratemporal fenestrae (though this may be due to the specimens being juveniles), and having roughly parallel suture contacts between the squamosal and parietal. It also appears to have had a smaller frontal boss than S. validum.[6][7] It also seems to have been more gracile overall.[13]

                        
        </div>
    </div>
    
        <br><br>
        <input type="button" onclick="jspdfFunction()" value="Click for pdf" /> 
    
</body>

</html>
Posted
Updated 4-Mar-18 23:52pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900