Home

Installation manual and quick start guide

image

Contents

1. Installation manual and quick start guide Author PerceivelT Limited Version 0 8 Status Beta Release Date 26 March 2013 http www scryber co uk e generated by scryber Installation manual and quick start guide 26 Mar 2013 Congratualtions on downloading Scryber Scryber has got to be the easiest and best way to generate dynamic pdf documents on the NET platform You start by defining your document content in XML add some styles to it even bind to some external data and once done render it to a file or out onto a stream with 2 lines of code It s now just as easy to create consistently styled documents as it is web pages when the content changes so can your documents Product catalogs invoices contracts instruction manuals articles and more Everything can be generated as a document your users can download save add to their files or iPad reading list This is not about printing this is about storing preserving and reporting Scryber is Open Source under LGPL so you can include it in your own commercial applications sites free of charge See About the badge Scryber is also easy to extend with full code support you can push in new components and alter the complete layout before rendering And if that is not sufficient you can even write your own components and include in the xml About this document This document takes you through the installation of the Scryber librari
2. Do you want to open or save Document pdf 89 6 KB from localhost P Document pdf Adobe Reader k E 10 x Open Save Y Cancel x File Edit View Window Help Tools Sign Comment Page 6 of 23 Copyright 2013 PerceivelT Ltd i scr ber Installation manual and quick start guide 26 Mar 2013 Adding some document content So that s OK but we haven t actually created any content Rather than simply typing lines out or pushing in lorem ipsum we will do some data binding with Scryber that shows off the dynamic capabilities of the libraries as well as give us some valuable content So let s do some cool stuff Where s our data coming from The data can be any XML data structue from a data set or loaded from a file but for this exmple the BBC produce a great rss feed for technology and it is also a good starting point for geting some generic information into the pdf document http feeds bbci co uk news technology rss xml The feed is a standard rss feed but has all the good things that make this a relevant test Dynamic uncontrolled input A reasonable amount of varied data A standard structure If you want to look at the xml structure follow the link above Layout some basic content The first thing we need to do is put some features on the document Scryber supports a simple set of components that can be built up into complex layouts similar to HTML There are div s spans in
3. referenced components creating your own components But we hope this has been enough to spark your interest There are also still lot s more things we want to do with scryber improve flow across regions fix relative postioning on full width and other gripes Plus tables lists SQL Object sources graphs text rtf import SVGL unicode security zipped streams forms and many nore extensions The best resource for finding out about scryber and asking questions 1s http www scryber co uk Documentation is still very light whilst we are in Beta phase but it s growing Get yourself over there take a look around and contribute e generated by Page 18 of 23 Copyright 2013 PerceivelT Ltd scryber Appendix A Source code v1 Blue Here s the source for all 4 files created with the this example Default aspx form id forml runat server gt Sole asp Button runat server Text Click Me for Tech ID GenerateTechPDF OnClick Page_GeneratePDF gt lt diy gt lt EOTm gt Default aspx cs public partial class _Default System Web UI Page protected void Page_Load object sender EventArgs e protected void Page GeneratePDF object sender EventArgs e PDFDocument doc PDFDocument ParseDocument App Data PDFs Document pdfx doc ProcessDocument this Response Page 19 of 23 Copyright 2013 PerceivelT Ltd Installation manual and quick start guide 26 Mar 2013 Gscry
4. 2013 My First PDF Let s create our first pdf If you are not using Visual Studio then it should be possible to follow along using your own knowledge or your development environment and specific passages in this section We are going to be doing this in a web application rather than a forms application but the process is almost exactly the same and we will highlight the changes at the end of the tutorial Create a new project gt Solution MyFrstPDF 1 project Let s start with a nice clean project so from Visual Studio close any E GQ MyFirstPDF existing solution and Add a New Project H 4 Properties E 5 References 1 From the dialog choose the NET Framework 3 5 from the top combo miis Ap box And then the web application project and save it to a useful place C3 Scryber Components mi inpr NE This will create the project and a default aspx page and a bunch of other Li Scrybper Lrawintg 3 Scryber Generation stuff mix Sac 2 Let s keep all our PDFs in a folder of their own so select project first C3 System then Project or website gt Add folder and call it PDFs C3 System Configuration C3 System Data 3 And finally lets add Document pdfx to our folder with a right click on the pe a folder and from the pop up menu choose Add New Item Choose the D Ape Data Scryber category on the right and select the Document pdfx item E Document pdfx 5 E ws m This will add a new document to our PDFs folder and add t
5. 2013 PerceivelT Ltd Apple sued by activist shareholder An activist shareholder is demanding Apple share out more of its 137bn 87bn cash pile to its investors Linkedin results beat hopes again Business focused social networking website LinkedIn s quarterly profits were double expectations sending shares up 1096 in after hours trading UK lags behind on DNA forensics Cross border co operation on terrorism and crime will be compromised unless the UK updates the technology it uses for DNA profiling experts warn Kids app translates grown up paper An app that transforms adult newspapers into child friendly text and animations has been launched in Japan EFU proposes new cvbercrime rules Gscryber Installation manual and quick start guide 26 Mar 2013 Add some images and links Adding images is easy and the BBC feed gives us a logo and an link to include in our feed under the image element of the channel lt image gt lt url gt http news bbcimg co uk nol shared img bbc_news_120x60 gif lt url gt lt title gt BBC News Technology lt title gt lt link gt http www bbc co uk news technology sa ns_mchannel rss amp amp ns_source PublicRSS20 sa lt link gt lt width gt 120 lt width gt lt height gt 60 lt height gt lt image gt Back in our Document pdfx in the heading Div let s put in an If test to make sure that we have an image on this feed and then we can build a link to a Uri wit
6. going to be building some more PDFs with that blue color so let s add the red style explicitly to the document We can simply extend the existing styles or add more than one style to specific components This is one solution to the requirements style Style applied class heading gt lt style Border color 971B1E sides Top Left Bottom Right style Style P Document 1 pdf Adobe Reader ini B x Fie Edit View Window Help x style Style applied class red text gt i3 PB 3 a 8 1 72 Ge 125 ime e Ble Tools Sign Comment lt style Fill color 971B1E gt 5 a e style Style style Style applied class red underline gt lt style Border color 971B1E gt style Style gt BBC News Technology The latest stories from the Technology section of the BBC News web site Date Tue 12 Feb 2013 15 41 24 GMT Tesla Motors in New York Times row Space marine row book back on sale Tesla Motors chief executive Elon Musk brands a An e book removed from Amazon because of a New York Times review of his company s electric trademark claim on the term space marine has saloon car as fake after its range is questioned been put back on sale Luxury Android has 7 000 price tag 4G to affect TV signal for 2m homes Upmarket brand Vertu has chosen Android over A campaign has been launched to help the UK Windows as the opera
7. The fishing industry in Iceland is shrugging off the Reg Turnill the BBC s aerospace correspondent prospect of European trade sanctions if it from the beginning of the space age through to continues to over fish one of Scotland s most This 1s quite a big thing It not only means that the layout is dynamic we knew that But it also means that the parsing of a document creates components that can be manipulated And that we can programatically add or remove components to that document as we require So how does the parser know which component it 1s to be created then All the xml files have namespaces that are references to NET Namespaces and Assemblies The parser looks at the XML elements and identifies their runtime Type based on the assembly and namespace And the classes decorated with the PDFParsableComponent attribute can be parsed from the document This means you can create your own components and include them within the xml They will be created and included as part of the document without changing the scryber source code Enjoy Page 17 of 23 Copyright 2013 PerceivelT Ltd i scr ber Installation manual and quick start guide 26 Mar 2013 A bit about the badge You may have noticed that scryber includes a badge on every page Generated by scryber We have thought long and hard about how to release this library We want to put it out there we want people to use it We have also spent a long time developing
8. ath else if siring Fiils e CommandNane Technology path http Teeds i co s technology rss xml PDFDocument doc PDFDocument ParseDocument App Data PDFs Document pdfx Scryber Data PDFXMLIDataSource src doc FindAComponentById BBCRss as Scryber Data PDFXMLDataSource if null src amp amp string IsNullOrEmpty path src SourcePath path doc ProcessDocument this Response Well let s render and see what happens when we choose Science Z Document 1 pdf Adobe Reader 0 x File Edit View Window Help Le x f L3 E e ba sl 13 125 B B O m2 ud Tools Sign Comment http localhost 6239 Default aspx Windows Internet Expl j e t localhost 6239 Defe Lp h 4 X File Edit View Favorites Tools Help NEWS yc D o amy Page Safety Toos Ly i BBC News Science amp Environment The latest stories from the Science amp Environment section of the BBC News web site Date Tue 12 Feb 2013 16 10 39 GMT Mince ban linked to horse scandal Africa edited over climate change An EU decision to reclassify a type of minced The BBC re edited the final episode of David meat played a significant part in creating the Attenborough s nature series Africa to remove a horsemeat crisis an ex Food Standards Agency piece of commentary about climate change scientist says o J4ceiand dismisses mackerel sanctions Veteran BBC space journalist dies
9. ature of Scryber The schemas are not just about intellisense they also actually relate the xml to the components and their capabilities The namespace for the schemas defines the namespace for the libraries and we will touch on this capability later on in the guide The visual studio installers add the files to the XML Schemas directory so Visual Studio can find them along with the installation path The vanilla installer will only install the schemas in the installation path Now when you create a document page component or style sheet you will have intellisense to add the things you need where you need them Configuration The Configuration directory of the instalation path contains a single config file This 1s simply there as assistance to adding to your own project configuration file If you want to alter the logging include non standard fonts custom image types or your own components then you will need to edit the configuration We will not be using these sections for this guide but there are other guides that cover the sections that you need to add Summary We should now have the dll s in a place where they can be easily added to projects the templates accessible and the schema files XSDs accessible to your development environment So we are now ready to move on to actually creating PDF documents enerated by Page 4 of 23 Copyright 2013 PerceivelT Ltd Gscryber Installation manual and quick start guide 26 Mar
10. be are called by the Australian parliament to appear before T3 a committee looking at pricing levels Apple sued by activist shareholder Dead Space cheat dents in game fees Smartphone future The phone wanting to replace your PC LinkedIn results beat hopes again Kids writing malicious hack code UK lags behind on DNA forensics Children as young as 11 years old have been using generated Page 14 of 23 Copyright 2013 PerceivelT Ltd i scr ber Installation manual and quick start guide 26 Mar 2013 Secure the files This is good and ready to show the client but there are the more mundane tasks to undertake first At the moment the Document pdfx and the Styles psfx are actual files on the disk Therefore they can be served by IIS and will just return to the client the xml content of the file We need to block this content from being served Or provide a mechanism that will serve the generated content Back in the scryber installation directory there was a configuration directory and within there a Scryber config file Open this config file and copy the content within the system Web httpHandlers to your config file add path psfx verb type System HttpForbiddenHandler add path ppfx verb type System HttpForbiddenHandler add path 2 pcfx verb type System HttpForbiddenHandler add path pdfx verb type System HttpForbiddenHandler And copy the content within
11. ber Installation manual and quick start guide 26 Mar 2013 Document pdfx lt xml vers ion 0T encoding ERO pdf Document xmlns pdf Scryber Components Scryber Components Version 0 8 0 0 Culture neutral Publ xmins style Scryber Styles Scryber Styles Version 0 8 0 0 Culture neutral PublickKeyToken 872 beb81 xmlns data Scryber Data Scryber Components Version 0 8 0 0 Culture neutral PublicKeyToken 872cbeb8 auleo Sind birue lt Styles gt lt style o yles Roef source T PDFS Styles psr gt lt Styles gt Sages JOd Sec stour cob My siae t Pagen LCONTENT gt data XMLDataSource id BBCRss source path http feeds bbei co uUk news technology rss xml cache durarion 5 gt data XMLDataSource data ForEach select rss channel datasource id BBCRss gt lt Templarce gt pdf Div style class heading gt odt Hilt tet T pah ciele oo be E I pds aloe l eext xXpakl descr pelom lt BR gt Date lt pdf Label text xpath lastBuildDate gt eos Daly pde Diy suylerclass conwenc lt data ForEach select item gt SIS dene Pdr Div gt pae Diver yle elass Troe iten daranti spadar E col T poah e lel e pdi gt lt pdf Label text xpath description gt lt lt els DV lt pd DIV lt Template gt lt data FPorEach PADI lt Template gt lt data BOSSIBIS CTS Content elis Sexe tesi Om lt Pages gt l
12. er Data PDFXMLDataSource src doc FindAComponentById BBCRss as Scryber Data PDFXMLDataSource if null src amp amp string IsNullOrEmpty path src SourcePath path doc ProcessDocument this Response Page 22 of 23 Copyright 2013 PerceivelT Ltd c generated Scr iber Installation manual and quick start guide 26 Mar 2013 Document pdfx xml versions 0 vencoding Uur iho lt pdf Document xmlns pdf Scryber Components Scryber Components Version 0 8 0 0 Culture neutral PublickeyToken 87 xmins style Scryber Styles Scryber Styles Version 0 8 0 0 Culture neutral PublicKeyToken 872cbeb81db952f xmlns data Scryber Data Scryber Components Version 0 8 0 0 Culture neutral PublickKeyToken 872cbeb81db952ffe auto bind true gt Styles style Styles Ref source PDFs Styles psfx style Style applied class heading gt lt style Border color 971B1E sides Top Left Bottom Right gt lt style Style gt style Style applied class red text gt style Fill color 971B1E gt lt style Style gt style Style applied class red underline gt style Border color 971B1E style Style Styles Pages lt pdf Section id MyFirstPage gt lt ContenTtT gt lt data XMLDataSource id BBCRss source parb ntt feeds Doei co uk news eechnolog rss lt mk cache _ durakrron 5 gt lt data XMLDataSource gt lt data ForBach
13. es and getting you set up generating your first pdfs All the examples and screen shots are based around Visual Studio 2010 but Scryber is simply a bunch of libriaries and you can use them on any NET solution and development environment of your choice By the end of the guide you should be able to create new documents add pages to the document and add content to those pages with styles and layout options A complete set of guides is being created at http www scryber co uk and there is also a forum to ask all the questions you need Release status Scryber is still very definitely in beta release There are lots of things that may not give you the layout you are expecting and you may also find bugs and errors occuring although we hope there are not too many and the messages are good Please be aware that if you do decide to take something to a fully loaded production platform you may regret it but if you get the results you want and it works for you then enjoy Page 2 of 23 Copyright 2013 PerceivelT Ltd Gscryber Installation manual and quick start guide 26 Mar 2013 Install files po t m CITEEUEN You should have already extracted the zip Oo E Scryber Core Scryber SupportFiles Scryber Core Release 0 8 zip v v hea Search Scryber Core Release 0 8 zip a i ee He archive that contains the installer along with Je Favorites Name Type Compressed size Password p Size this guide WE Desk
14. f Div style class heading gt pdf Hl text xpath title gt lt pdf Hi gt lt pdf Label text xpath description gt lt BR gt Date pdf Label text xpath lastBuildDate gt lt BR gt lt pdt Div gt lt Template gt lt data ForEach gt lt Content gt CGU Up mw s EN We can then wrap a for each loop atound the 43 x B e ja e amp pe E B e g Tools Siga Comment heading Div that will enumerate over the one BBC News Technology rss channel element in the feed to generate the The latest stories from the Technology section of the content The text of the headings and labels are BBC News web site then changed to bind based on the xpath Date Sat 09 Feb 2013 03 04 48 GMT value for the attribute Hit your Click Me button again as there is no need to rebuild and you should generate a new pdf with some new dynamic content We can see the content being brought in from the RSS feed and flowing nicely around the page If your machine does not have direct access to the internet download the feed and save it somewhere in your project You can change the source path in the Xml data source to a local file reference Page 8 of 23 Copyright 2013 PerceivelT Ltd i scr ber Installation manual and quick start guide 26 Mar 2013 Bringing in the items Top title is done but we now need to include all the RSS feed items into the page as well We can do this by si
15. h an image as the content Hit the button one more time to generate the document and you should be able to click the image and it will take you to the technology news page Pretty Sweet and we didn t even have to adjust any other components it all just flowed data If test string length image url amp gt 6e gt Template lt pdf Link action Uri file xpath image link new window true alt xpath image title gt lt Content gt lt pdf Image src xpath image url style width xpath image width style padding 10 gt lt Content gt pdf Link p Document 1 pdf Adobe Reader loj x File Edit View Window Help lt Template gt data If f di Ei A e bg Uu Tools Sign Comment 4 li 7 BIBIC QE EVWS BBC News Technology Windows Internet Explorer Od JU bbc co uk news te O t X mn ppc News Technology x File Edit View Favorites Tools Help fay gt v Page Safety Tools e g et ue BIBIC O Signin News Sport Weather iPlayer Radio More NEWS TECHNOLOGY POL Mn V MCL GMM tM Scotland Wales Business Politics Health Education SciEnvironment lechnology Entertainment amp Arts Technology logy section of the BBC News web site eb 2013 18 09 55 GMT 11 February 2013 Last updated at 18 09 transactions Facebook sued over like button Facebook is facing legal action over
16. he required E Web config references Set up the page What we need to do now 1s generate the actual pdf file based on the contents of Document pdfx Let s do this when a button is clicked on the web page So Open the Default aspx page in the Visual Studio html source editor if it s not already And add a button like below We need to respond to the click event in our page code behind So open Default aspx cs vb and add a using for Scryber Components plus the handler below after the page load method For C using Serybems compornenbs protected void Page GeneratePDF object sender EventArgs e PDFDocument doc PDFDocument ParseDocument App_Data PDFs Document pdfx doc ProcessDocument this Response All the source code is available in Appendix A for this first version generated by Page 5 of 23 Copyright 2013 PerceivelT Ltd C scryber Installation manual and quick start guide 26 Mar 2013 Hit the button So all we do now is run our project ini xi e localhost 62 O w b o X A localhost x _ P 1019 button fp A om Page Safety Toos La di EB You should then be prompted to open Document pdf in your favourite PDF Viewer Our page should open in a browser and we can click the File Edit View Favorites Tools Help Open it and Hello World will appear There you have it your first PDF document flying over the network to greet you in just 2 lines of code
17. ill color 00PPPE gt lt style Style gt style Style applied class rss item gt lt style Margins bottonm l0pt style Padding bottom 3pt gt lt style Border color 00FFFF sides Bottom width l1pt gt lt style Style gt lt style Styles gt Page 21 of 23 Copyright 2013 PerceivelT Ltd Hs scr iber Installation manual and quick start guide 26 Mar 2013 Appendix B Source code v2 Red Here s the source for the 3 modified files updated for the red style with the changes highlighted in red Default aspx form id forml runat server gt oui lt asp Button runat server Text Click Me for Tech ID GenerateTechPDF OnCommand Page_GeneratePDF CommandName Technology gt lt br gt lt asp Button runat server Text Click Me for Science ID GenerateSciencePDF OnCommand Page_GeneratePDF CommandName Science gt lt diy gt EE OS Default aspx cs public partial class Default System Web UI Page protected void Page_Load object sender EventArgs e protected void Page GeneratePDF object sender CommandEventArgs e string path string Empty if string Equals e CommandName Science path http feeds bbci co uk news science and environment rss xml else if string Equals e CommandName Technology path http feeds bbci co uk news technology rss xml PDFDocument doc PDFDocument ParseDocument App Data PDFs Document pdfx Scryb
18. its use ofthe like button and some other features of the social network Watch Listen mmm Apple sued by activist shareholder An activist shareholder is demanding Apple share Tech patents reach record high Bankrupt Kodak gets 525m lifeline out more of its 1 37bn 87bn cash pile to its Facebook and Yahoo end patent row What is the future of Robot patient with a investors television heartbeat Space marine row book back on sale Linkedin results beat hopes again An e book removed from Amazon because of a Features amp Analysis trademark claim on the term space marine has been put back on sale Business focused social networking website Linkedin s quarterly profits were double expectations sending shares up 10 in after hours trading Government drops website blocking Warhammer What is the appeal UK lags behind on DNA forensics Cross border co operation on terrorism and crime 4G to affect TV signal for 2m homes s will be compromised unless the UK updates the A campaign has been launched to help the UK homes which will experience television interference when 4G services roll out Colossus battle How revealing a wartime secret rewrote history UK operators 4G bidding war begins Help scheme runs out of TV boxes Booth babes Tech shows review use of scantily clad models Australia summons technology giants Ex US President Bush emails hacked Technology giants Apple Microsoft and Ado
19. l for 2m homes campaign has been launched to help the UK homes hich will experience television interference when 4G ervices roll out Australia summons technology giants echnology giants Apple Microsoft and Adobe are called by the Australian parliament to appear before a committee looking at pricing levels Kids writing malicious hack code Children as young as 11 years old have been using programming skills to write malicious code to steal data a security company warns BBC to trial selected shows online An approved 12 month trial marks the first time that BBC programmes will be released on iPlayer ahead of heduled TV broadcasts Ex US President Bush emails hacked eak demand for advertising space 1m a year botnet gets shut down lt Content gt lt pdf Section gt lt Pages gt is shut down in a major security operation Thousands of PCs internet access cut housands of computers running Microsoft s Windows A quick review into headings and labels and flowing nicely into a series of pages But boy is it UGLY Let s give this document some style Page 10 of 23 Copyright 2013 PerceivelT Ltd ex B Blea le So why does it block The pdf Page component is set by default not to allow content to overflow and There is however a different component that does overflow pdf Section If we change the page Tools Sign Comment computer hacker steals personal emails and photographs belongi
20. le Style gt applied class content gt lt style Style applied type pdf Div lt style Columns count 2 alley width 28pt lt style Font size 12pt bold false italic false lt style Style gt width 1pt gt Installation manual and quick start guide 26 Mar 2013 p Document 1 pdf Adobe Reader k nml x File Edit View Window Help x f E B e bg 1 2 xf 1107 gt Im E2 Ka Tools Sign Comment i gt BBC News Technology The latest stories from the Technology section of the BBC News web site Date Mon 11 Feb 2013 18 09 55 GMT Facebook sued over like button Facebook is facing legal action over its use of the like button and some other features of the social network Space marine row book back on sale An e book removed from Amazon because of a trademark claim on the term space marine has been put back on sale 4G to affect TV signal for 2m homes A campaign has been launched to help the UK homes which will experience television interference when 4G services roll out Australia summons technology giants Technology giants Apple Microsoft and Adobe are called by the Australian parliament to appear before a committee looking at pricing levels Kids writing malicious hack code Children as vouina as 11 vears ald have heen This is starting to look pretty cool What say we add some images and links Page 13 of 23 Copyright
21. line text labels panels images lines and drawings all of which can be styled and positioned inline as a block relativly or even absolutely So for the content we are going to have a heading block with some textual elements in it So remove the Hello World text and add the elements as below pdf Document xmlns pdt http xmlns style http xmlns data http j www zcryber co uk schemas vas Scryber Data xsd auto bind true gt amp Pages pdf Page id FirstPage gt lt Content gt pdf Div style class heading gt pdf H1 text This is the heading pdf H1l pdf Label text And this is going to be the description pdf Label lt BR gt Date pdf Label text Today gt lt pdf Div gt lt Content gt lt pdt Page gt And this is going to be the description Date Today lt Pages gt lt pdt Document gt generated by Page 7 of 23 Copyright 2013 PerceivelT Ltd i scryber Installation manual and quick start guide 26 Mar 2013 Reference the RSS feed If you are unfamiliar with Xml or XPath then don t worry you will still be able to follow along First thing is to add a new XML Data source into the Document pdfx lt Content gt data XMLDatasSource id BBCRss source pathz cache duration 5 gt amp data ForEach select rss channel datasource id BBCRss gt lt Template gt pd
22. ll out Australia summons technology giants echnology giants Apple Microsoft and Adobe are called by the Australian parliament to appear before a committee looking at pricing levels Kids writing malicious hack code Children as young as 11 years old have been using programming skills to write malicious code to steal data a security company wams BBC to trial selected shows online An approved 12 month trial marks the first time that BBC programmes will be released on iPlayer ahead of scheduled TV broadcasts Ex US President Bush emails hackt o tts s Page 9 of 23 Copyright 2013 PerceivelT Ltd scr iber Installation manual and quick start guide 26 Mar 2013 Overflow onto a new page therefore will only be a single rendered page component to a section component we should see a different result Change it now at the top and bottom and hit Click Mel lt Papes gt lt pdf Section id FirstPage gt Content File Edit View Window Help fad Bels tw BBC News Technology he latest stories from the Technology section of the BBC News web site Date Mon 11 Feb 2013 12 27 35 GMT Facebook sued over like button Facebook is facing legal action over its use of the like button and some other features of the social network Space marine row book back on sale An e book removed from Amazon because of a rademark claim on the term space marine has been put back on sale 4G to affect TV signa
23. mply including another for each loop inside the rss channel as below We do not need to specify the datasource as we have an existing data context We are wrapping each item in 2 Div tags with style class attributes on them and the whole thing is wrapped in an outer div with another style class This will be used a little later on don t forget to add it E All being well we should end up with a Tae Rsk coca single page of content that flows down Template to the bottom of the page pdf Div style class r pdf Div style class amp pdf H2 text ixpath t RC pdf H25 pdf Label text i xpath c ption pdt Div gt pdf Div Template lt data ForEach gt pdf Div gli Document 1 pdf Adobe Reader i E 7 inl x File Edit View Window Help x ta EST a za e E C 2 le Tools Sign Comment m BBC News Technology he latest stories from the Technology section of the p BBC Mews web site Date Mon 11 Feb 2013 12 27 35 GMT Facebook sued over like button Facebook is facing legal action over its use of the like button and some other features of the social network Space marine row book back on sale An e book removed from Amazon because of a rademark claim on the term space marine has been put back on sale 4G to affect TV reception in 2m homes A campaign has been launched to help the UK homes vhich will experience television interference when 4G services ro
24. n we came to process the document each component had a full style built based upon these style declarations Because our pdf Section is actually a page PDFSection inherits from the PDFPage then it had the pdf Page style definition applied to it Our Div on the other hand has a heading class declared on it and all the attributes defined on the style were applied to this Div Some of these styles will also cascade down to inner components e g the Font size and style Inside our heading Div we have text and labels that are now being rendered at 12 point bold The H1 component is actually defined with a base style that has a Font size and style set on it so these heading options were overridden but the centre alignment was not overridden Styles are a complex subject and rely on a number of capabilities but we hope this serves as a little introduction A note about units and color Within the content of the style there are a number of attributes that accept measurement units and colors Units are real numbers optionally postfixed with a scale The supported scales are Points pt The standard unit of measurement for PDF documents and the default unit If no scale is provided then it will be assumed the measurement is in Points 72pt 1 inch Inches in The postfix must be in e g 2 5in A double quote notation is not supported Millimeters mm The postfix must be mm 25 4mm 1 inch The pixel is not a suppor
25. ng to former US President George H W Bush and his family US media report Dead Space cheat dents in game fees Glitches in Dead Space 3 are allowing gamers to avoid paying in game charges undermining publisher EA s attempt to extend the use of micro transactions pple sued by activist shareholder An activist shareholder is demanding Apple share out more of its 137bn 87bn cash pile to its investors Linkedin results beat hopes again Business focused social networking website Linkedin s quarterly profits were double expectations sending hares up 10 in after hours trading UK lags behind on DNA forensics Cross border co operation on terrorism and crime will be compromised unless the UK updates the technology it uses for DNA profiling experts warn Kids app translates grown up paper An app that transforms adult newspapers into child riendly text and animations has been launched in apan EU proposes new cybercrime rules Net firms banks hospitals and other may be required o report all cyber break ins under new EU proposals Online subscribers surge at NY Times Profits at the New York Times triple as a surge in the newspaper s online subscriptions more than of GZ Life like robotic patients are being used in central cotland by doctors and nurses who want to practise botnet that took control of up to one million computers heir clinical skills VIDEO Tech startups choose Newcastle Newcastle has quietly built a reputati
26. on among entrepreneurs as the place to launch their businesses Great we now have a PDF document that 1s reaching out for external content and this 1s binding with XPath Gscryber Installation manual and quick start guide 26 Mar 2013 Bring on the Style Scryber has very comprehensive style support All the information about how to render a page and it s components is driven from styles so let s add some to this document Above the Pages element add a new Styles element to the page Within this element we can either add styles within the XML directly or add one or more references to external style documents The content is exactly the same Because we may want to use our styles on more than one PDF for a consistent look and feel we ll create an external file Add the reference Within your project right click on the PDFs folder and choose Add Existing Item Navigate to the templates directory and choose the Styles psfx Within the Document pdfx Styles element add a Style Ref element and point it to our new Styles file lt xml version 1 8 encoding utT 8 gt lt style Styles xmlns pdf http i xmlns style xmlns data http lt style Style applied type pdf Page gt style Page size A4 orientation Portrait lt style Style gt lt style Styles gt lt Styles gt lt style Styles Ref source Styles psfx gt lt Styles gt Add the definitions We can see that there is al
27. ready a style declared in this file that will be applied to all components of style Margins left 20pt bottom 40pt right 20pt top 15pt gt type Page specifying a size and orientation So let s add to this style and give the page some well needed margins lt style Style applied class heading gt lt style Border color FFFF width 1pt sides Top Left Right gt pc ipo ge Sree eau And while we re at it we can add a new Style lt style Margins top 20pt bottom 2ept gt definition for the class heading that our main title lt style Position h align Center gt A estyle Fant bali true size i2pt 5 block in the document was declared with style Styl ME NE Hit the button again to see what difference this has made p Document pdf Adobe Reader E O xl File Edit View Window Help x f L3 B e KJ Tools Sign Comment BBC News Technology The latest stories from the Technology section of the BBC News web site Date Mon 11 Feb 2013 16 54 50 GMT Facebook sued over like button Facebook is facing legal action over its use of the Page 11 of 23 Copyright 2013 PerceivelT Ltd i scr ber Installation manual and quick start guide 26 Mar 2013 So What just happened When we hit the button the Document pdfx file was parsed Within that file 1s a reference to this Styles psfx file so this was also parsed and included in the document Whe
28. scryber investing a lot of time and effort and we think this is the best way we can continue to work on scryber It stays open source under LGPL Everyone has access everyone can use it and no one has to pay for it and it puts a badge on the page so everyone can see where it came from and may be use it themselves If you need to remove the badge or have a client that wants it removed then we d really like you to buy a small licence file from us that will remove the badge at www scryber co uk otherwise you can get your hands dirty in the code and remove the badge rendering from the page We obviously prefer the former and we hope to create extensions plugins that support the same capability freely available but licence is required for badge removal We also hope that others including yourselves will create plugins with the same capability If you do remove the code to render the badge the LGPL says you can do that if it s for internal use or you also release under LGPL But you will have to invest effort in keeping it up to date with the scryber releases We like the badge and we like scryber and we like it open source What s Next This has been a pretty deep dive into the capabilities of scryber Documents pages components styles binding and code has all been touched on And we hope you have enjoyed it There are still a lot more things you can do with scryber component positioning embedded fonts background images
29. select rss channel davcasource 1d BBCRss gt lt Template gt lt pdn Diy Style class heading gt data If test string length image url amp gt 0 gt lt Template gt lt pdf Link action Uri file xpath image link new window true alt xpath image title gt lt Content gt lt pdf Image src xpath image url style width xpath image width style padding 10 gt lt Content gt pdf Link Template data If Xpdf H1 style class red text text xpath title gt lt pdf H1 gt pdt Label cext xpacn descripcion gt lt BR gt Date lt pdf Label text xpath lastBuildDate gt UAI BE Dany pdf Div style class content gt data ForEach select item gt lt Template gt pdf Div style class rss item red underline codd Diy style class rss item data gt lt pdf H2 style class red text text xpath title gt lt pdf H2 gt lt pdf Label text xpath description gt lt 7 OG Dany isole c Diy gt lt Template gt reati Or bebe veyebe e Dial lt Template gt lt data Fortach gt lt Content gt lt paT Section gt lt Pages gt lt pdr Documene Page 23 of 23 Copyright 2013 PerceivelT Ltd C scr ber
30. t pdt Document Page 20 of 23 Copyright 2013 PerceivelT Ltd C scr ber Installation manual and quick start guide 26 Mar 2013 Styles psfx style Styles xmlns pdf Scryber Components Scryber Components Version 0 8 0 0 Culture neutral PublickKeyToken 87 xmins style Scryber Styles Scryber Styles Version 0 8 0 0 Culture neutral PublicKeyToken 872cbeb81db952f4 xmlns data Scryber Data Scryber Components Version 0 8 0 0 Culture neutral PublickeyToken 872cbeb81db952ffe gt lt style Style applied type pdf Page gt lt style Page size A4 orientation Portrait gt lt stylesMargins letr2 20pt bottoms 40pb5t cricobhpet205t Eop lope y lt st yle Style gt lt style Style applied class heading gt style Border color 00FFFF width l1pt sides Top Left Right gt lt style Background color 3EBEBEET lt stvyle Paddang anM OEN lt stylesMargins top 20pt bortom 20t gt lt style Position h align Center gt lt style Font bold true size 12pt gt lt style Style gt lt style Style applied type pdf Div applied class content gt style Columms coune 2 valley wieden 20pE gt lt style Font size 12pt bold false italic false gt lt styles Style gt lt style Style applied type pdf H2 gt lt style Font size 4pt gt lt style s ELl Color f00PPPE gt lt style Style gt style Style applied type pdf H1 gt lt style F
31. ted scale as the layout is not represented on screen dimensions and the percentage notation is also not supported as the page size is a known dimension The style Postion element does however support a boolean fill width attribute to push sizing to the container width Colours can be identified as one of the known standard 16 colors or by their hexadecimal notation If the notation is 2 characters it is assumed to be grayscale FF white 77 gray 00 black If the notation is 3 characters it is assumed to be RGB short FFF white FOO red 000 black If the notation is 6 characters it is the full RGB notation HFFFFFF white FF0000 red 000000 black Colors can also be defined in G RGB or HSL decimal notation in the format G 255 or RGB 255 255 255 or HSL 0 0 100 which all denote white All other formats will throw an exception Page 12 of 23 Copyright 2013 PerceivelT Ltd v SCT iber Styling the items in the feed So let s add a little style to the items that come back in the feed and see what we can do with this lt style Style applied type pdf H2 gt lt style Font size 14pt gt lt style Fill color 0FFFF gt lt style Style gt lt style Style applied type pdf Hi gt lt style Fill color FFFF gt lt style Style gt lt style Style applied class rss item gt lt style Margins bottom 16pt gt style Padding bottom 3pt gt lt style Border color FFFF sides Bottom lt sty
32. the system webServer handlers to your config file name Scryber Styles path psfx verb type System Web HttpForbiddenHandler name Scryber Components Page path ppfx verb type System Web HttpForbiddenHandler name Scryber Components UserComponent path pcfx verb type System Web HttpForbiddenHandler name Scryber Components Document path pdfx verb type System Web HttpForbiddenHandler If you want to be doubly safe the put remove gt elements above these in the config file You may also need to make IIS pass requests through for these file extensions rather than handling them directly depending on which version of IIS you are using and whether the application is set up as integrated pipeline Page 15 of 23 Copyright 2013 PerceivelT Ltd C scr ber Installation manual and quick start guide 26 Mar 2013 Just a few small changes It was all going so well and we showed the document to the client and they were over the moon But there were just a few changes in the feedback 1 That blue is corporate color but doesn t fit well with the red of the BBC logo Can we make the borders the Same red 2 The bottom border should also be on the heading Pretty minor all in all Oh and they also found out that a lot of their clients read the science feed rather than technology feed So can we offer them the choice of download Adjust the style Well we already know we are
33. ting system for its new homes which will experience television handset interference when 4G services roll out yurrpepta capelle raptor ys Tesco trials new film and TV service Australia summons technology giants Supermarket giant Tesco trials a new TV and film Technology giants Apple Microsoft and Adobe lt pdf Div style class rss item red underline gt Again all the source code is available to copy and paste in Appendix B for this first version Sorted for the styling but what about that extra feed We are going to need to go back to our Default aspx page for that Page 16 of 23 Copyright 2013 PerceivelT Ltd i scr ber Installation manual and quick start guide 26 Mar 2013 Change the document in code Let us add a second button to our aspx page and have both buttons raise a Command event so we know what is required Science or Technology lt form id forml runat server gt div gt amp asp Button runat server Text Click Me for Tech ID GenerateTechPDF OnCommand Page GeneratePDF CommandMame Technology gt lt br gt amp asp Button runat server Text Click Me for Science ID GenerateSciencePDF OnCommand Page GeneratePDF CommandName Science gt lt div gt lt form gt We now have 2 commands coming to our event and based on that we can change the feed protected void Page GeneratePDF object sender CommandEvent i string path string Empty if string Ente emp M Science p
34. top J Configuration File folder i voios Ji sena He folder If you haven t already done so execute the Recent Places 4 Templates File folder R gener Scryber Common dll Application extension 25KB No installer E ae i p If you use Visual Studio 2010 check the ome pean eee one i Visual Studio 2010 option es Eee ur If you use Visual Studio 2012 check VS amp Computer 2 0 1 2 ig Networ peni If you don t use VS then you do not need to choose either but you will need to copy the de H templates to your solution folder when B 7 required Assemblies There are 7 assemblies dll s that make up the core of Scryber and all work together to generate PDF s When you want to use Scryber in a project is it usually easier to just reference all the libraries They are fully signed and the installer will add them to the GAC by default All the assemblies are currently built against NET 3 5 If you want to reference them in NET 4 then you may need to alter your application configuration to support dual mode execution Templates The Templates are added to your visual studio templates directory and the installation directory They contain pre formed xml documents that can be added to your projects quickly and easily There are 4 in total each named appropriately Document pdfx a top level document Page ppfx a page that can be referenced from any document Component pcfx a single component that can be added to pages St
35. yles psfx an external styles collection that can be referenced from any document Whilst the file extensions do not provide any extra capability currently it is a convention that you should observe for future compatibility The content of Document pdfx is shown below and this would render a perfect little Hello World lt xml version 1 0 encoding utf 8 gt pdf Document auto bind true xmlns pdf Scryber Components Scryber Components Version 0 8 0 0 Culture neutral PublicKeyToken 872cbeb81db952fe xmlns style 2 Scryber Styles Scryber Styles Version 0 8 0 0 Culture neutral PublicKeyToken 872cbeb81db952fe xmlns data Scryber Data Scryber Components Version 0 8 0 0 Culture neutral PublicKeyToken 872cbeb81db952fe gt Pages lt pdf Page id MyFirstPage gt COmeene Hello World lt Content gt lt pdf Page gt lt Pages gt lt pdf Document gt During this guide we will be using the templates exclusively to add new scryber components to the project Page 3 of 23 Copyright 2013 PerceivelT Ltd C scr ber Installation manual and quick start guide 26 Mar 2013 Schema s The XSDs are very important There are 5 of them and they work together to help you write structured documents pages and components without knowing what fits where All Xml editors should be able to read and understand these schemas so that when you try to add a component you can see where it should go This 1s a key fe

Download Pdf Manuals

image

Related Search

Related Contents

Untitled    Princess 261905  Hitachi 26LD8000TA User's Manual  continua a leggere  User Guide  MELSEC-L CPU Module User`s Manual (Built-In  安全に関するご注意  user manual - Outlet Electrodomésticos  Benutzerhandbuch für Polycom HDX  

Copyright © All rights reserved.
Failed to retrieve file