I am going to disagree with the previous poster, at least with regards to the statement that there is no good reason to question Einhard's account of the coronation. They are correct that his Vita of Charlemagne approaches hagiography on some levels, and it gives us reason to pause when considering how Einhard chooses to depict Charlemagne, particularly when considering the literary tropes and cultural traditions he employs.
The reluctance to accept or the outright refusal of political or ecclesiastical authority is a common literary trope throughout late antiquity and the early medieval period. The good ruler does not scheme or plot to seize power, but instead has power thrust upon him, often unwillingly. Einhard's description of Charlemagne's coronation falls right in line with this tradition, casting Charlemagne as the surprised and humble monarch who would not dare aspire to the imperial seat. The extent to which the literary trope reflects reality or whether refusal and feigned reluctance was part of the 'performance' of a larger tradition of coronations need to be considered. It does not necessarily mean that Einhard's account is untrue, but he has his own spin to add to the events he is recording and we cannot take his assumptions of Charlemagne's inner motivations at face value.
Now Einhard does have a couple of things going for him. Most accounts of the coronation express Charlemagne's ignorance of the events that were about to take place. With the exception of a discussion on Christian empire in Alcuin's letters, there is also little documentation that would indicate that his court was discussing or preparing for imperial rule when he left for Rome. However, none of the surviving accounts provide a full treatment of the events surrounding the coronation, and attempts to synthesize a cohesive narrative often gloss over contradictions and omissions that reflect the unique perspective and bias of individual accounts. Likewise, the lack of evidence indicating preparations for an imperial title do not necessarily indicate that the conversation had not taken place. The survival of contemporary texts is dicey at best, and considering the emphasis on the reluctant acquisition of power, a lack of evidence is not all that surprising. Either way, we should be careful not to build our arguments too much around silence in the textual record.
Einhard completed his biography of Charlemagne some time after his death during the reign of his son Louis the Pious, and while he had lived at Charlemagne's court, his account of the coronation is not the closest to the events in question, and the changing political situation might reflect how he and his contemporaries chose to frame the narrative. A fragment of the Annals of Lorsch dating to just after 800 contains entries for both 799 and 800, providing what may be the closest account to the events in question. Now the AL have thier own spin and bias, and the author purposefully selects and omits events consistent with the narrative, but it perhaps represents the earliest, official Frankish version of the events in question. Unlike later sources, the AL do not describe the coronation as a papal initiative, but rather as a decision agreed upon by the assembly of clergy and laity that met following Charlemagne's arrival in Rome. This assembly began on Nov. 30th or Dec. 1, but AL do not mention when the decision was reached and obfuscates its chronology with the coronation on Christmas. Instead of being jumped by the pope, the AL present the coronation as the decision of the assembly, to which Charlemagne consents, unwilling to deny their request.
Like other sources for the coronation, the AL is intent on preserving the reluctance of Charlemagne and his lack of planning. Charlemagne decides to visit Rome only in August for the sole purpose of justifying Pope Leo III, who he had received the previous year following the latter's harassment and expulsion from the Holy See for his alleged crimes. The author also confirms that the assembly's primary business, and the reason that it was called, was for the vindication of Leo. However, the text does not emphasize the right of the pope to select the emperor as found in later accounts. Leo's position as pope at the time of the coronation was still unstable, and it seems unlikely that the Franks would hitch their imperial claims to an unsteady star. While Leo would still crown Charlemagne in the AL narrative, the decision was ultimately not his to make. Perhaps more importantly, Roger Collins argues that the vacant throne in the East, coupled with Charlemagne's country of the former imperial seats in the West, were sufficient grounds to crown Charlemagne and so did not require arguments of papal investiture to fend off accusations of usurpation. These would later become necessary following the ascension of Nicephorus to the throne and Byzantine rejection of Charlemagne's title, and are reflected in later accounts, including Einhard's.
While the AL is our earliest account, I want to stress that it is not absolved of any biases or that it is not subject to the possibilities of misinformation. But it does provide us with an early, compelling alternative to Einhard's famous surprise coronation. There are also further bits and pieces of information that complicate the traditional narrative. Before the coronation, Charlemagne had been in contact with envoys from the Patriarch of Jerusalem, culminating with his reception of the keys to the city and the Holy Sepulchre while in Rome, before the coronation. The symbolic gesture suggests the submission of the patriarch to Charlemagne instead of Constantinople, with whom Jerusalem had previously aligned, and could imply the patriarch was expecting a new emperor, but the evidence is circumspect. It is frustrating, but it is likely that we will never know how much Charlemagne knew about his impending coronation or what role the pope played in the affair. However, there is sufficient grounds to question the traditional narrative, and while the truth may elude us, the debate lets us to examine in depth the complicated political world of the eighth and ninth centuries!
That story comes to us from Charlemagne's biographer Einhard (in his work Vita Karoli Magni), who actually knew the man and was the personal secretary of his son, Louis the Pious. Scholars debate when, exactly, Einhard wrote his biography, but the inclusion of Charles's will at the end suggests at least part of it was written after his death in 814, which was 14 years after Charles was crowned Emperor. Further, if you read the rest of the work, it's clear that Einhard's biography is not at all dissimilar to a hagiography, so much of his work has to be taken with a grain of salt. None the less, the story does come from (roughly) Charles's own time. To quote Einnhard directly (emphasis mine):
When he made his last journey thither, he also had other ends in view. The Romans had inflicted many injuries upon the Pontiff Leo, tearing out his eyes and cutting out his tongue, so that he had been comp lied to call upon the King for help [Nov 24, 800]. Charles accordingly went to Rome, to set in order the affairs of the Church, which were in great confusion, and passed the whole winter there. It was then that he received the titles of Emperor and Augustus [Dec 25, 800], to which he at first had such an aversion that he declared that he would not have set foot in the Church the day that they were conferred, although it was a great feast-day, if he could have foreseen the design of the Pope. He bore very patiently with the jealousy which the Roman emperors showed upon his assuming these titles, for they took this step very ill; and by dint of frequent embassies and letters, in which he addressed them as brothers, he made their haughtiness yield to his magnanimity, a quality in which he was unquestionably much their superior.
EDIT: To be clear, Einhard did live at Charles's court at the time Charles was crowned, although whether he was in Rome at the time, I cannot say. He had lived at court from ca. 792 CE. Charles was crowned Emperor on Christmas Day in the year 800 CE. Point being that he was in a position to have known if Charles had actually been displeased with the event. We'll likely never be able to say with any greater certainty whether Einhard's version of the event is true or not, so whether you believe the story really comes down to whether you believe Einhard or not. Although I am not a scholar of medieval Europe, far as I know, this story is generally accepted as having been true because there is no good reason to dismiss it.
edit 2: a digit.