troubleshooting Question

Compressing PDFs

Avatar of Tra71
Tra71 asked on
JavaASPVB Script
2 Comments1 Solution383 ViewsLast Modified:

Is there a way of compressing a pdf at the point of creating it?  The PDFs being created are too large...

We're using Persits AspPDF.

Many thanks

Set objPDF = Server.CreateObject("Persits.Pdf")
		Set objDoc = objPDF.CreateDocument
	'Get HTML stream to populate PDF...
		If Request.QueryString("Orient") = "L" Then
			objDoc.ImportFromUrl strHTML, "landscape=true; PageWidth=841; PageHeight=595; TopMargin=36; BottomMargin=36;"
			objDoc.ImportFromUrl strHTML, "PageWidth=595; PageHeight=841; TopMargin=36; BottomMargin=36;"
		End If
	'Check for Client...

		Set objConn = Server.CreateObject("ADODB.Connection") : objConn.Open appDBConn
		Set objRS = Server.CreateObject("ADODB.Recordset") : Set objRS.ActiveConnection = objConn
		Set Param = objDoc.ImportInfo
		Index = Param("Page")
		Y = Param("Y")
		X = 0
		Set Page = objDoc.Pages(Index)
		objRS.CursorLocation = adUseServer : objRS.Cursortype = adOpenStatic : objRS.Locktype = adLockOptimistic
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros