Export to PDF

What can I add in code for write the extension .pdf at the end of the generate file?
Because it works correctly but the generate file has no the .pdf, only the name. I’m working with java.
Thanks!

Hi,
PDFWriter.java includes method outputPDF which outputs generated pdf:

private void outputPDF(HttpServletResponse resp) throws Throwable {
	this.pdf.wrap();
	resp.setContentType("application/pdf");
	this.pdf.getData().writeTo(resp.getOutputStream());
}

You may add HTTP-header here to specify filename.

Hi,

I created one scheduler chart with timeline view. When i have given print option using php, the output was completely different. The headers and the events are not displayed correctly in the PDF output. Attaching the two screen shots for the reference. Is any other settings I have missed?.Attached the screenshots for the reference.



csmoorthi.

I am using scheduler and am getting this error on PHP5:

date() [function.date]: It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Chicago’ for ‘CDT/-5.0/DST’ instead

Warning: date() [function.date]: It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Chicago’ for ‘CDT/-5.0/DST’ instead in /home2/valleyra/public_html/cal/generate.php on line 26

The pdf generation works with the grid.

When I look at the XML data error I get the following:








25|26|27|28|29|30|01
02|03|04|05|06|07|08
09|10|11|12|13|14|15
16|17|18|19|20|21|22
23|24|25|26|27|28|29
30|31|01|02|03|04|05

Any thoughts?

When I use the updated file the day, week, and aggenda views work. The calendar monthly view no longer prints properly.

I tried the new version of dhtmlxscheduler_pdf.js

It now prints the week and agenda views so that is good, but now fails on the monthly calender view. The old version works on the month view, but not on the week, day, or aggenda view. Is it possible there is an error in the underlying script?

date() [function.date]: It is not safe to rely on the system’s timezone settings.

You need to configure timezone in php settings of change error reporting level in php.ini

As for month export issues - can you provide some sample where it can be reconstructed?

The pdf print module works for the current month, but then when I go to the next in the schedular I get: Undefined offset: -1 with pdf page to print. The months of Oct & Nov give the same error, but Dec works. Any thoughts?

I have problem exporting a Grid View to PDF. It gave me an error :

Uncaught TypeError: Cannot read property ‘className’ of null (dhtmlxscheduler_pdf.js:10)

Do you have any idea?

Unfortunately export in pdf doesn’t support grid view mode, we will update export functionality to support it in the nearest future.

I use .net method to export to pdf.
My server side code is :

[code] Dim generator = New SchedulerPDFWriter()
context.Response.ContentType = generator.ContentType
Dim xml = context.Server.UrlDecode(context.Request.Form(“mycoolxmlbody”))
Dim pdfStream = generator.Generate(xml)

pdfStream.WriteTo(context.Response.OutputStream)[/code]

In the last line I receive the error :
Specified argument was out of the range of valid values.
Parameter name: offset

How can i avoid this problem ?
Thanks.

Hi,
check the value of context.Request.Form(“mycoolxmlbody”). This exception can be thrown if null is passed to the SchedulerPDFWriter.Generate.
If its valid xml please try the latest build of the export tool, does the issue appears there?
scheduler-pdf-net_121015.zip (521 KB)

This is the value of context.request.form(“mycoolxmlbody”)

<data profile='color'><scale mode='week' today='15/10/2012 - 21/10/2012'><x> <column><![CDATA[Lun, Ottobre 15]]></column> <column><![CDATA[Mar, Ottobre 16]]></column> <column><![CDATA[Mer, Ottobre 17]]></column> <column><![CDATA[Gio, Ottobre 18]]></column> <column><![CDATA[Ven, Ottobre 19]]></column> <column><![CDATA[Sab, Ottobre 20]]></column> <column><![CDATA[Dom, Ottobre 21]]></column></x><y> <row><![CDATA[07:00]]></row> <row><![CDATA[08:00]]></row> <row><![CDATA[09:00]]></row> <row><![CDATA[10:00]]></row> <row><![CDATA[11:00]]></row> <row><![CDATA[12:00]]></row> <row><![CDATA[13:00]]></row> <row><![CDATA[14:00]]></row> <row><![CDATA[15:00]]></row> <row><![CDATA[16:00]]></row> <row><![CDATA[17:00]]></row> <row><![CDATA[18:00]]></row> <row><![CDATA[19:00]]></row> <row><![CDATA[20:00]]></row></y></scale> <event week='undefined' day='0' type='event' x='12.380196972701433' y='700' width='87.90402538171723' height='200' len='0'><header><![CDATA[14:00 - 16:00]]></header><body backgroundColor='' color=''><![CDATA[Text]]></body></event> <event week='undefined' day='1' type='event' x='112.38019697270144' y='400' width='87.90402538171723' height='95.23809523809524' len='0'><header><![CDATA[11:00 - 11:30]]></header><body backgroundColor='' color=''><![CDATA[Nuovo evento]]></body></event></data>
Is it a valid xml?

Hi,
yes, its valid and should work with the latest version of the export tool

i’ve got a scheduler with monday-friday week view, topdf is not working at this view, i wonder if i could change/add some code to make it work, could you help me? thank you very much. :ugeek: :bulb:

Hi,

i am using scheduler.toPDF(url,“fullcolor”) to print my calendar as a pdf. But I see that the PDFWriter has its own fixed set of colors and that is getting printed via my pdf document. How can I generate a pdf with the same color coding for events as that on the actual calendar?

Looks like the xml generated by scheduler.toXML() is different in the “month” mode.

All other modes generate the event color as both the background color and the color attribute for the body element as shown below. This looks like a bug. Can you please address this and publish a newer version??


<body backgroundColor=’#8a2be2color=’#000>

When i call the pdf export, i obtain an error message :

And the file error_report…xml contain this :

%3Cdata%20profile%3D'color'%3E%3Cscale%20mode%3D'week'%20today%3D'3%20D%C3%A9c%202012%20-%209%20D%C3%A9c%202012'%3E%3Cx%3E%0A%3Ccolumn%3E%3C!%5BCDATA%5BLun%2C%20D%C3%A9cembre%203%5D%5D%3E%3C%2Fcolumn%3E%0A%3Ccolumn%3E%3C!%5BCDATA%5BMar%2C%20D%C3%A9cembre%204%5D%5D%3E%3C%2Fcolumn%3E%0A%3Ccolumn%3E%3C!%5BCDATA%5BMer%2C%20D%C3%A9cembre%205%5D%5D%3E%3C%2Fcolumn%3E%0A%3Ccolumn%3E%3C!%5BCDATA%5BJeu%2C%20D%C3%A9cembre%206%5D%5D%3E%3C%2Fcolumn%3E%0A%3Ccolumn%3E%3C!%5BCDATA%5BVen%2C%20D%C3%A9cembre%207%5D%5D%3E%3C%2Fcolumn%3E%0A%3Ccolumn%3E%3C!%5BCDATA%5BSam%2C%20D%C3%A9cembre%208%5D%5D%3E%3C%2Fcolumn%3E%0A%3Ccolumn%3E%3C!%5BCDATA%5BDim%2C%20D%C3%A9cembre%209%5D%5D%3E%3C%2Fcolumn%3E%3C%2Fx%3E%3Cy%3E%0A%3Crow%3E%3C!%5BCDATA%5B05%3A00%5D%5D%3E%3C%2Frow%3E%0A%3Crow%3E%3C!%5BCDATA%5B06%3A00%5D%5D%3E%3C%2Frow%3E%0A%3Crow%3E%3C!%5BCDATA%5B07%3A00%5D%5D%3E%3C%2Frow%3E%0A%3Crow%3E%3C!%5BCDATA%5B08%3A00%5D%5D%3E%3C%2Frow%3E%0A%3Crow%3E%3C!%5BCDATA%5B09%3A00%5D%5D%3E%3C%2Frow%3E%0A%3Crow%3E%3C!%5BCDATA%5B10%3A00%5D%5D%3E%3C%2Frow%3E%0A%3Crow%3E%3C!%5BCDATA%5B11%3A00%5D%5D%3E%3C%2Frow%3E%0A%3Crow%3E%3C!%5BCDATA%5B12%3A00%5D%5D%3E%3C%2Frow%3E%0A%3Crow%3E%3C!%5BCDATA%5B13%3A00%5D%5D%3E%3C%2Frow%3E%0A%3Crow%3E%3C!%5BCDATA%5B14%3A00%5D%5D%3E%3C%2Frow%3E%0A%3Crow%3E%3C!%5BCDATA%5B15%3A00%5D%5D%3E%3C%2Frow%3E%0A%3Crow%3E%3C!%5BCDATA%5B16%3A00%5D%5D%3E%3C%2Frow%3E%0A%3Crow%3E%3C!%5BCDATA%5B17%3A00%5D%5D%3E%3C%2Frow%3E%3C%2Fy%3E%3C%2Fscale%3E%0A%3Cevent%20week%3D'undefined'%20day%3D'2'%20type%3D'event'%20x%3D'191.97433926960474'%20y%3D'865.9090909090909'%20width%3D'52.87847906712553'%20height%3D'300'%20len%3D'0'%3E%3Cheader%3E%3C!%5BCDATA%5B13%3A40%20-%2016%3A40%5D%5D%3E%3C%2Fheader%3E%3Cbody%20backgroundColor%3D''%20color%3D''%3E%3C!%5BCDATA%5Btest%20Ecriture%5D%5D%3E%3C%2Fbody%3E%3C%2Fevent%3E%0A%3Cevent%20week%3D'undefined'%20day%3D'2'%20type%3D'event'%20x%3D'247.4322563400047'%20y%3D'1000'%20width%3D'52.87847906712553'%20height%3D'200'%20len%3D'0'%3E%3Cheader%3E%3C!%5BCDATA%5B15%3A00%20-%2017%3A00%5D%5D%3E%3C%2Fheader%3E%3Cbody%20backgroundColor%3D''%20color%3D''%3E%3C!%5BCDATA%5BTest%20Lecture%5D%5D%3E%3C%2Fbody%3E%3C%2Fevent%3E%3C%2Fdata%3E

I think it’s a problem with the caracter encoding format but i don’t know how to resolv it.

Sorry, for my previous message.
I’ve found the solution.

I have 2 other problems :

  • the events are not exactly inside the column of the day (see the image attached, there is 2 events on the same day)
  • how is it possible to set the begin_hour and end_hour of the schedule in the pdf ?

Would love to see Export to PDF for Timeline view.