Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Rendering PDFs Natively in SQL


Rendering PDFs Natively in SQL

Author
Message
Ted Cooper-351490
Ted Cooper-351490
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 297
Awesome delivery. Great problem and solution. Would like to see a solution generating PDFs with barcodes.

To the nay sayers with compaints about processing and security I say, get over it! If the software can do it, let it be done.

If you can't keep your database secure, don't keep a secure database.

If you can't process some extra CPU cycles, then get another CPU! The cycles have to go somewhere right? Shall we ask about the overhead of running it through SQLCLR? Run it through a SQL Express instance CLR assembly somewhere else?

Excellent article, topic and discussion. Thanks.
Kristian Ask
Kristian Ask
Valued Member
Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)

Group: General Forum Members
Points: 71 Visits: 251
For me the reserve isn't that you shouldn't do it. I simply think that there is probably at least on server dedicated to processing these and similar requests and that's where I'd put the code too.
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)

Group: General Forum Members
Points: 44956 Visits: 39862
Ted Cooper-351490 (5/8/2013)
Awesome delivery. Great problem and solution. Would like to see a solution generating PDFs with barcodes.

To the nay sayers with compaints about processing and security I say, get over it! If the software can do it, let it be done.

If you can't keep your database secure, don't keep a secure database.

If you can't process some extra CPU cycles, then get another CPU! The cycles have to go somewhere right? Shall we ask about the overhead of running it through SQLCLR? Run it through a SQL Express instance CLR assembly somewhere else?

Excellent article, topic and discussion. Thanks.


BWAAA_HAAA!!!! The only thing I don't like about this article (I don't really care for SQLCLR because of the abuse that has been heaped upon it but will tolerate good stuff. I'd have to test the stuff in the article, of course!:-D) is that the script turns xp_CmdShell and Ole Automation Procedures off instead of checking to see if they were on to begin with. Not all of us suffer the delusion that having these things turned off provides any more than a 3ms hurdle that a potential attacker is already prepared to jump. Doesn't anyone realize that only those with "SA" can run these things (well, unless someone was dumb enough to grant privs to individuals through proxies)?

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
     Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is usually not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
David Rueter
David Rueter
SSC-Enthusiastic
SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)

Group: General Forum Members
Points: 105 Visits: 570
Jeff,

Thanks for chiming in. I'm a big fan of yours and have learned a lot from you.

FYI, the attached script does in fact check the status of xp_CmdShell and Ole Automation, and returns them to their original settings.

(Between trying to simplify some things for the article and some later edits to the code, the code excerpts in the article are not identical to the attached script.)

If you (or anyone else) finds any problems or errors, please let me know.
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)

Group: General Forum Members
Points: 44956 Visits: 39862
David Rueter (5/8/2013)
Jeff,

Thanks for chiming in. I'm a big fan of yours and have learned a lot from you.

FYI, the attached script does in fact check the status of xp_CmdShell and Ole Automation, and returns them to their original settings.

(Between trying to simplify some things for the article and some later edits to the code, the code excerpts in the article are not identical to the attached script.)

If you (or anyone else) finds any problems or errors, please let me know.


Hoo-boy. I've got to get my eyes checked. Blush Apparently I looked at only the dynamic code and not the "IF" qualifiers nor the capture of the original settings. My most sincere apologies. You're absolutely correct.

The good part about me missing that and being made aware of my mistake is now there's nothing in the article that I take grand exception to. :-) Well done!

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
     Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is usually not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
taylor_benjamin
taylor_benjamin
SSC Rookie
SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)

Group: General Forum Members
Points: 34 Visits: 51
I stand corrected. Please accept my apologies for my phrasing which now appears to me as ungracious. I truly wish your company great success!

The point I really wish to make is that this architecture has only one scaling solution...scale up.

Other options allow both scaling up and out. Other individuals have brought out other benefits for continuing to do the work outside of SQL Server, so I won't expand here.

Again, please continue to post...you did a great job communicating the problem and the solution.

I post daily at www.sswug.org and have found you need to have thick skin. I highly value comments from others. Not everyone is going to agree with you. In fact, your own opinion is likely to change over time and as you have different experiences.

Cheers,

Ben
johannconsult
johannconsult
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 10
I fail to see how this solution prevents tampering with the coupons. Surely if the only access that users have is to the web server this is no safer than building the PDF there?
Jonathan Mallia
Jonathan Mallia
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1009 Visits: 1279
Very good article mate.
Thanks.
ccmalls26
ccmalls26
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 0
Wonderful.

Share a website with you ,

( http://www.ccmalls.net/ )

Believe you will love it.

We accept any form of payment.
Phil Parkin
Phil Parkin
SSCrazy Eights
SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)

Group: General Forum Members
Points: 8308 Visits: 19449
ccmalls26 (5/9/2013)
Wonderful.

Share a website with you ,

( http://www.ccmalls.net/ )

Believe you will love it.

We accept any form of payment.


Reported as spam.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search